select serverproperty ('productversion')

(select parsename(convert(varchar,serverproperty ('productversion')),4))
DECLARE @CurrentVersion tinyint
set @CurrentVersion = (select parsename(convert(varchar,serverproperty ('productversion')),4))

IF
	@CurrentVersion >= 10 
BEGIN 
	PRINT 'Server version 10+'
END
ELSE
	PRINT 'Server version 9-'
Last modified: September 17, 2019

Author

Comments

Write a Reply or Comment