好的,我在Technet上搜索了这个问题的答案,但没有结果.
我只想打印一个包含两个字符串变量的整数变量.
这是我的代码,没有运行:
print 'There are ' + @Number + ' alias combinations did not match a record'
这似乎是一个基本特性,我无法想象它在t-SQL中是不可能的.但如果不可能,请直接说出来.我似乎找不到一个直截了当的答案.
好的,我在Technet上搜索了这个问题的答案,但没有结果.
我只想打印一个包含两个字符串变量的整数变量.
这是我的代码,没有运行:
print 'There are ' + @Number + ' alias combinations did not match a record'
这似乎是一个基本特性,我无法想象它在t-SQL中是不可能的.但如果不可能,请直接说出来.我似乎找不到一个直截了当的答案.
declare @x INT = 1 /* Declares an integer variable named "x" with the value of 1 */
PRINT 'There are ' + CAST(@x AS VARCHAR) + ' alias combinations did not match a record' /* Prints a string concatenated with x casted as a varchar */