HEELPBOOK - How to check SQL Server version ############################################# 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 (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: ############### sp_MSgetversion EXEC master..sp_MSgetversion Character_Value _______________ 10.50.1600.1 1 3 (1 row(s) affected) ############### 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 ############### 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) ############ ARTICLE INFO ############# Article Month: June Article Date: 25/06/2012 Permalink: http://heelpbook.altervista.org/2012/how-to-check-sql-server-version/ Source: http://sqlandme.com/2011/05/13/how-to-check-sql-server-version/ Language: English View more articles on: http://www.heelpbook.net/ Follow us on Facebook: http://it-it.facebook.com/pages/HeelpBook/100790870008832 Follow us on Twitter: https://twitter.com/#!/HeelpBook Follow us on RSS Feed: http://feeds.feedburner.com/Heelpbook Follow us on Delicious: http://delicious.com/heelpbook