Option 1
SELECT
SERVERPROPERTY('productversion'),
SERVERPROPERTY ('productlevel'),
SERVERPROPERTY ('edition')
SERVERPROPERTY('productversion'),
SERVERPROPERTY ('productlevel'),
SERVERPROPERTY ('edition')
and get the details on the link: http://support.microsoft.com/kb/321185
Option 2
EXEC master..xp_msver
Option 3
SELECT @@version
Option 4
-- Option 4
DECLARE @ver NVARCHAR(128) = CAST(serverproperty('ProductVersion') AS NVARCHAR)
SET @ver = SUBSTRING(@ver, 1, CHARINDEX('.', @ver) - 1)
SET @ver =
CASE
WHEN @ver = '7' THEN 'SQL Server 7'
WHEN @ver = '8' THEN 'SQL Server 2000'
WHEN @ver = '9' THEN 'SQL Server 2005'
WHEN @ver = '10' THEN 'SQL Server 2008/2008 R2'
WHEN @ver = '11' THEN 'SQL Server 2012'
WHEN @ver = '12' THEN 'SQL Server 2014'
ELSE 'Unsupported SQL Server Version'
END
SELECT @ver
DECLARE @ver NVARCHAR(128) = CAST(serverproperty('ProductVersion') AS NVARCHAR)
SET @ver = SUBSTRING(@ver, 1, CHARINDEX('.', @ver) - 1)
SET @ver =
CASE
WHEN @ver = '7' THEN 'SQL Server 7'
WHEN @ver = '8' THEN 'SQL Server 2000'
WHEN @ver = '9' THEN 'SQL Server 2005'
WHEN @ver = '10' THEN 'SQL Server 2008/2008 R2'
WHEN @ver = '11' THEN 'SQL Server 2012'
WHEN @ver = '12' THEN 'SQL Server 2014'
ELSE 'Unsupported SQL Server Version'
END
SELECT @ver
No comments:
Post a Comment