Version Öğrenme Scripti

Aşağıda ki scripti çalıştırarak versiyon bilgilerini ve OS hakkında bilgi alabilirsiniz.

DECLARE @sqLTR NUMERIC(8, 2)

SELECT @sqLTR = LEFT(Cast(Serverproperty('productversion') AS VARCHAR), 4)

SELECT CASE @sqLTR
		WHEN 7.00
			THEN 'SQL Server 7'
		WHEN 8.00
			THEN 'SQL Server 2000'
		WHEN 9.00
			THEN 'SQL Server 2005'
		WHEN 10.00
			THEN 'SQL Server 2008'
		WHEN 10.50
			THEN 'SQL Server 2008 R2'
		WHEN 11.00
			THEN 'SQL Server 2012'
		WHEN 12.00
			THEN 'SQL Server 2014'
		WHEN 13.00
			THEN 'SQL Server 2016'
		ELSE 'UnKnown/Unsupported SQL Server Version'
		END AS SqlServerType
	,Serverproperty('ProductVersion') AS ProductVersion
	,Serverproperty('ProductLevel') AS ProductLevel
	,Serverproperty('Edition') AS Edition
	,Serverproperty('ResourceLastUpdateDateTime') AS LastUpdateDateTime
	,CASE RIGHT(Substring(@@VERSION, Charindex('Windows NT', @@VERSION), 14), 3)
		WHEN '5.0'
			THEN 'Windows 2000'
		WHEN '5.1'
			THEN 'Windows XP'
		WHEN '5.2'
			THEN 'Windows Server 2003 R2'
		WHEN '6.0'
			THEN 'Windows Server 2008'
		WHEN '6.1'
			THEN 'Windows Server 2008 R2'
		WHEN '6.2'
			THEN 'Windows Server 2012'
		ELSE 'UnKnown Windows OS Type'
		END AS OSVersion
GO

Örnek :

version1

Leave a Reply

Your email address will not be published. Required fields are marked *