select @rno=rno from deleted; convert(numeric,@rno); @rno=@rno/1000;
消息 156,级别 15,状态 1,过程 t2,第 11 行 关键字 'convert' 附近有语法错误。select @rno=rno from deleted; set @rno = cast(@rno as numeric) SQL code: select @rno=rno from deleted; SET @rno=convert(numeric,@rno); SET @rno=@rno/1000;
SQL code: select @rno=rno from deleted; SET @rno=convert(numeric(18,5),@rno); SET @rno=@rno/1000;
设计一下精度
哦!原来如此!这样才行! 可是这样转过之后又出现个问题
消息 102,级别 15,状态 1,过程 t2,第 12 行 '@rno' 附近有语法错误。 转换成数值型之后为什么不能进行数学运算呢?? SQL code: declare @rno varchar(20) set @rno=convert(numeric(18,2),@rno); set @rno=@rno/1000; select @rno=rno from deleted;