locked
Product Version - SQL SP and hotfix discrepencies, is this a bug? RRS feed

  • Question

  • Hi, I have a PowerShell Script that installs Service Packs and CU's for SQL Server 2005.  However I am finding a discrepency between the FileInfo Product Version of SQL 2005 SP's and CU's.  Here is a PS snippet

    function GetFileProductVersion ([string]$filename)
    {
      $info = [system.Diagnostics.FileVersionInfo]::GetVersionInfo($filename)
      $script:ProductVersion = $info.productversion
      Log "Patch product version is $script:ProductVersion"
    }
    
    

    What I am wanting to do is to check ahead of time before I even attempt to apply a given patch and determine if it is needed by comparing the Product Version of the patch with the current applied version of the given SQL 2005 Server.  I get the Server version via the following TSQL

    SELECT SERVERPROPERTY ('productversion') AS Version
    

    Here is the problem, everything works fine as long as it is an SP but I have yet to find the correct product version information for any of the files that are in a CU.  Why is the Product Version WRONG for all the SQL 2005 CU's?  Or is there a way to get the correct product version information from a given Hotfix, CU patch file? 

     

     


    Thanks, -ja
    Thursday, February 24, 2011 1:29 AM

All replies

  • For files, use the core file "sqlservr.exe" that is located under each SQL instance directory.  For example,

    C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\sqlservr.exe

    For connection to SQL Server, use one of T-SQL queries as below.

    SELECT

     

    @@VERSION AS 'SQL Server Version'

    Both tell the detail of version number including SP and CU that are installed to SQL server instance.

    Best Regards.

    Yuhong


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Wednesday, March 2, 2011 7:35 PM
  • For SQL Server versions of every hotfix, you may ref: http://www.sqlsecurity.com/FAQs/SQLServerVersionDatabase/tabid/63/Default.aspx
    Mark as Answer if it helps. This posting is provided "AS IS" with no warranties, confers no rights.
    Thursday, March 3, 2011 9:46 AM
  • hi John, did Yuhong and I answered your question? Anything still not clear or we also could help?
    Mark as Answer if it helps. This posting is provided "AS IS" with no warranties, confers no rights.
    Friday, June 10, 2011 2:22 AM