SELECT @@VERSION

  • When I execute SELECT @@version command then I get following answer:

    Microsoft SQL Server 2008 (SP1) - 10.0.2714.0 (X64) May 14 2009 16:08:52 Copyright (c) 1988-2008 Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 6.0 (Build 6002: Service Pack 2) (VM)

    Microsoft SQL Server 2005 - 9.00.3042.00 (X64) Feb 10 2007 00:59:02 Copyright (c) 1988-2005 Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 5.2 (Build 3790: Service Pack 2)

    Microsoft SQL Server 2000 - 8.00.2055 (Intel X86) Dec 16 2008 19:46:53 Copyright (c) 1988-2003 Microsoft Corporation Enterprise Edition on Windows NT 5.2 (Build 3790: Service Pack 2)

    Once this says SP1 and at another place this says service pack 2. According to me first is for sql server and another is for Windows OS. Is my understanding correct?

  • yes

    ---------------------------------------------------------------------

  • You can also execute following command to check Database version

    select serverproperty ('ProductVersion')

    ---------------------------------------------------
    "Thare are only 10 types of people in the world:
    Those who understand binary, and those who don't."

  • You can also execute following command to check Database version

    select serverproperty ('ProductVersion')

    ---------------------------------------------------
    "Thare are only 10 types of people in the world:
    Those who understand binary, and those who don't."

  • You can also execute following command to check Database version

    select serverproperty ('ProductVersion')

    ---------------------------------------------------
    "Thare are only 10 types of people in the world:
    Those who understand binary, and those who don't."

  • If you want to find out version information, you can use @@Version function. However, in SQL Server 2005, you won’t get the service pack level of the SQL Server.

    If you run SELECT @@VERSION in SQL Server 2005, you will get following output.

    Microsoft SQL Server 2005 - 9.00.4207.00 (X64) Copyright (c) 1988-2005 Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 5.2 (Build 3790: Service Pack 2)

    PN: here Service Pack 2 means service pack of the operating system, not the service pack of the SQL Server. To find out the service pack level in SQL Server 2005, you need to run following T-SQL.

    SELECT SERVERPROPERTY('ProductLevel') ServicePack

    In SQL Server 2008 this is what you get for SELECT @@VERSION.

    Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (X64) Copyright (c) 1988-2008 Microsoft Corporation Developer Edition (64-bit) on Windows NT 5.2 <X64> (Build 3790: Service Pack 2)

    In this you can see that you will get the Service pack level from the @@VERSION.

    Apart from above commands, following stored procedures also give you the server information.

    EXEC master..xp_msver

    EXEC sp_server_info




    My Blog: http://dineshasanka.spaces.live.com/

Viewing 6 posts - 1 through 5 (of 5 total)

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