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-'
Comments