|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Arithmetic overflow error converting numeric to data type numericColumn 'Grade' in table is-
numeric length 5 Precision 4 Scale 2 Declare @Grade decimal Set @Grade = 19.5 Insert into table (Grade) Values(@Grade) Arithmetic overflow error converting numeric to data type numeric. Do I need an explicit convert for this? Thank you. -hazz You have to specify precision (default is 18) and scale (default is 0).
> Declare @Grade decimal declare @grade decimal(4, 2).... AMB Show quoteHide quote "hazz" wrote: > Column 'Grade' in table is- > numeric length 5 > Precision 4 > Scale 2 > > Declare @Grade decimal > Set @Grade = 19.5 > Insert into table (Grade) > Values(@Grade) > > Arithmetic overflow error converting numeric to data type numeric. > > Do I need an explicit convert for this? Thank you. -hazz
Show quote
Hide quote
"hazz" <h***@discussions.microsoft.com> wrote in message DECLARE @Grade decimal(4,2)news:6E0DC39F-9339-4B30-AFBC-8749997638B3@microsoft.com... > Column 'Grade' in table is- > numeric length 5 > Precision 4 > Scale 2 > > Declare @Grade decimal > Set @Grade = 19.5 > Insert into table (Grade) > Values(@Grade) > > Arithmetic overflow error converting numeric to data type numeric. > > Do I need an explicit convert for this? Thank you. -hazz SET @Grade = 19.5 INSERT TableName(Grade) VALUES (@Grade) GO
Other interesting topics
|
|||||||||||||||||||||||