--> (Word) | --> (PDF) | --> (Epub) | --> (Text) |
--> (XML) | --> (OpenOffice) | --> (XPS) | |
The most common way to check SQL Server is to use @@VERSION configuration function. It returns version, architecture, OS version and build date for current instance.
SELECT @@VERSION AS [Version]
Version
—————————————
Microsoft SQL Server 2008 R2 (RTM) – 10.50.1600.1 (Intel X86)
Apr 2 2010 15:53:02
Copyright (c) Microsoft Corporation
Enterprise Edition on Windows NT 6.0 <X86> (Build 6002: Service Pack 2)
(1 row(s) affected)
Another way is to use SERVERPROPERTY() metadata function. For a full list of properties that can be returned, check BOL.
SELECT SERVERPROPERTY('ProductVersion') AS [Version]
Version
—————————————
10.50.1600.1
(1 row(s) affected)
You can also use extended stored procedures to check SQL Server version:
[tab:sp_MSgetversion]
sp_MSgetversion:
EXEC master..sp_MSgetversion
Character_Value
——————– ———– ———–
10.50.1600.1 1 3
(1 row(s) affected)
[tab:xp_msver]
xp_msver:
EXEC master..xp_msver 'ProductVersion'
Index -- Name -- Internal_Value -- Character_Value
—— ——————————– —
2 -- ProductVersion -- 655410 -- 10.50.1600.1
(1 row(s) affected)
To see the full list of properties returned by xp_msver, execute it without any arguments.
EXEC master..xp_msver
[tab:xp_instance_regread]
xp_instance_regread:
DECLARE @returnValue NVARCHAR(100)
EXEC master..xp_instance_regread
@rootkey = N'HKEY_LOCAL_MACHINE',
@key = N'SOFTWARE\Microsoft\MSSQLServer\Setup',
@value_name = N'Version',
@value = @returnValue output
SELECT @returnValue AS [Version]
Version
—————————————————————————————————-
10.50.1600.1
(1 row(s) affected)
[tab:END]
Hope This Helps!
SOURCE | LINK (sqlandme.com) | LANGUAGE | ENGLISH |