Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 decimal data type

Author  Topic 

sharankruthi
Starting Member

22 Posts

Posted - 2009-07-24 : 01:45:02
How to insert decimal values?

EXEC inserttax
'1',
'07/17/2009',
'Tax1',
'1',
'1',
'1',
'100',
CONVERT(decimal(10.000)),
'10'

CONVERT(decimal(10.000)), - > this column is decimal. Its giving me error

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-07-24 : 01:47:37
EXEC inserttax
'1',
'07/17/2009',
'Tax1',
'1',
'1',
'1',
'100',
CONVERT(decimal, 10.000),
'10'



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

sharankruthi
Starting Member

22 Posts

Posted - 2009-07-24 : 02:03:46
Msg 156, Level 15, State 1, Line 9
Incorrect syntax near the keyword 'CONVERT'.

Am getting this error
Go to Top of Page

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-07-24 : 02:51:56
Hi
your query convertion is not nessasary.. you have already using the decimal value right 10.000
OR
you can use the variable to assign the values then reuse the varibale on the procedure call

-------------------------
R..
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-07-24 : 04:18:08
Yes. You dont need explicit convertion as it is already a decimal
Also, you cant use functions over the variable/value when you directly use them inside EXEC

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -