日期:2014-05-18 浏览次数:20648 次
DECLARE @a BIGINT,
@b BIGINT ;
SET @a=900;
SET @b=20120512*10000+@a;
SELECT @b;
/*结果:
消息 8115,级别 16,状态 2,第 4 行
将 expression 转换为数据类型 int 时出现算术溢出错误。
*/
DECLARE @a BIGINT,
@b BIGINT ;
SET @a=900;
SET @b=cast(20120512 as bigint)*10000+@a;
SELECT @b;
-- 结果
201205120900