在写SQL语句的时候,要注意数字与字符串的相加
declare @num int
declare @str varchar(20)set @num=4
set @str='aaa'--select @num+@str
--报错
--服务器: 消息 245,级别 16,状态 1,行 7
--将 varchar 值 'aaa' 转换为数据类型为 int 的列时发生语法错误。select convert(varchar(20),@num)+@str