DECLARE @fix int, @ver varchar(100) 
SELECT @fix = 16, @ver = '15.11'
DECLARE @S VARCHAR(15), @V1 VARCHAR(5), @V2 VARCHAR(5), @R VARCHAR(5), @FS varchar(5), @F int, @E INT, @VRS varchar(100) 
EXEC X_GET_PROP 'PROJECT','VERSION_FIX', @FS OUTPUT 
SET @F = convert(int, @FS) 
EXEC X_GET_PROP 'PROJECT','SIGNATURE', @S OUTPUT 
EXEC X_GET_PROP 'PROJECT','VERSION_MAJOR', @V1 OUTPUT 
EXEC X_GET_PROP 'PROJECT','VERSION_MINOR', @V2 OUTPUT 
EXEC X_GET_PROP 'PROJECT','VERSION_RELEASE', @R OUTPUT 
SET @VRS = ISNULL(RTRIM(@V1)+'.'+RTRIM(@V2), '') 
SET @E = CASE WHEN @S = 'SMETA' AND @VRS = @ver AND @F = @fix THEN 1 ELSE 0 END 
SET @VRS = @VRS + CASE WHEN @FS = '' THEN '' ELSE 'SP' + RTRIM(@FS) + '' END 
SELECT @E AS ENABLE, 
	'БД Подсистем Бюджет-КС' + CHAR(13) + CHAR(10) + 'версии ' + @VRS + CHAR(13) + CHAR(10)+ 
		CASE @E WHEN 0 THEN 'Обновление невозможно.' WHEN 1 THEN '' END AS DESCRIPTION, 
	@S AS SIGNUM, convert(int, @V1) AS VERSION, convert(int, @V2) AS RELEASE