Search code examples
sql-serverreporting-servicesservicepacks

How to determine SQL Server version on a reporting server


All of our production instances of reporting services are split into the web server components and the reports database components.

I know that you can detect the instance of SQL Server on a database server by the following TSQL:

SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'),
SERVERPROPERTY ('edition')

However, in our case, the reporting servers do not have a database server components installed. So how do I detect what service pack is installed in this situation?


Solution

  • Manually, or using web scraping, browse to

    http://reportServerName/ReportServer 
    

    and the version number is at the bottom of the page.

    Or programatically:

    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://<Server Name>/_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);
            }
        }
    }