How to know the version of the sqlserver and operating system used for sqlserver by command.

  • Hi All

    How to know the version of the sqlserver and operating system used for sqlserver by command.

  • if version means build : select @@version

  • Here's a script I use to get the this information. It provides pretty much the same information.

    /*

    This script displays SQL Server version information, but it does not

    identify the service pack. I found a Microsoft knowledge base article

    that describes how to tell.

    The value of the ProductVersion indicates the service pack. This information

    was taken from http://support.microsoft.com/kb/321185

    Release Sqlservr.exe

    RTM 2005.90.1399

    SP1 2005.90.2047

    SP2 2005.90.3042

    */

    SET NOCOUNT ON

    SELECT CAST(@@SERVERNAME AS VARCHAR(25)) AS ServerName,

    CAST(SERVERPROPERTY('productversion') AS VARCHAR(25)) AS Version,

    CAST(SERVERPROPERTY ('productlevel') AS VARCHAR(12)) AS Level,

    CAST(SERVERPROPERTY ('edition') AS VARCHAR(40)) AS Edition

    PRINT @@SERVERNAME

    PRINT ''

    EXEC xp_msver

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply