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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Dynamically assigning values for Numeric (p,s)

Author  Topic 

Tony@abc
Starting Member

1 Post

Posted - 2005-03-23 : 18:00:44
I would like to set the value of scale using a local variable in a numeric datatype.

e.g.
DECLARE @DecimalPlaceHolder int,
@CalcResult varchar(50)

SET @DecimalPlaceHolder = 2

CAST(@CalcResult AS NUMERIC(10,@DecimalPlaceHolder))

I am not able to do this and et error 'Incorrect syntax near '@DecimalPlaceHolder''

Is there a way of achieving this?

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2005-03-23 : 19:17:13
Why?

- Jeff
Go to Top of Page
   

- Advertisement -