我们的所有报告服务生产实例都分为Web服务器组件和报告数据库组件.
我知道您可以通过以下TSQL检测数据库服务器上的SQL Server实例:
SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')
但是,在我们的示例中,报告服务器没有安装数据库服务器组件.那么在这种情况下如何检测安装了哪些Service Pack?
手动或使用网页抓取,浏览到
http://reportServerName/ReportServer
版本号位于页面底部.
或者以编程方式:
using System; using System.Collections.Generic; using System.IO; using System.Text; using System.Web; using System.Web.Services; using System.Web.Services.Protocols; class Sample { static void Main(string[] args) { // Create proxy object and set service // credentials to integrated ReportingService2006 rs = new ReportingService2006(); rs.Url = "http:///_vti_bin/ReportServer/" + "ReportService2006.asmx"; rs.Credentials = System.Net.CredentialCache.DefaultCredentials; try { // Set the server info header rs.ServerInfoHeaderValue = new ServerInfoHeader(); // Make a call to the Web service CatalogItem[] items = rs.ListChildren("/"); // Output the server version and edition to the console Console.WriteLine("Server version: {0}", rs.ServerInfoHeaderValue.ReportServerVersionNumber); Console.WriteLine("Server edition: {0}", rs.ServerInfoHeaderValue.ReportServerEdition); } catch (Exception e) { Console.WriteLine(e.Message); } } }