R
Robin_Fang
Unregistered / Unconfirmed
GUEST, unregistred user!
A Select MCode,Qty,Price,0 As Unit Into #CurAA From DeliverD Where Left(MCode,3)='304' And Qty>0
B Update #CurAA Set Unit=Price/Qty
C Select * From #CurAA
D Drop Table #CurAA
Unit的值没有小数值;
若将A行改成:
Select MCode,Qty,Price,0.00 As Unit Into #CurAA From DeliverD Where Left(MCode,3)='304' And Qty>0
Update #CurAA Set Unit=Price/Qty
Select * From #CurAA
Drop Table #CurAA
则运行过程中会出现:
Server: Msg 8115, Level 16, State 8, Line 1
Arithmetic overflow error converting numeric to data type numeric.
The statement has been terminated.
并且Unit的值始终为A行中定义的小数位数:".00"
EMail:Robin_Fang@21CN.COM
B Update #CurAA Set Unit=Price/Qty
C Select * From #CurAA
D Drop Table #CurAA
Unit的值没有小数值;
若将A行改成:
Select MCode,Qty,Price,0.00 As Unit Into #CurAA From DeliverD Where Left(MCode,3)='304' And Qty>0
Update #CurAA Set Unit=Price/Qty
Select * From #CurAA
Drop Table #CurAA
则运行过程中会出现:
Server: Msg 8115, Level 16, State 8, Line 1
Arithmetic overflow error converting numeric to data type numeric.
The statement has been terminated.
并且Unit的值始终为A行中定义的小数位数:".00"
EMail:Robin_Fang@21CN.COM