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)
 convert and cast issue in dynamic sql

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-06-21 : 06:40:22
thanksfor help writes "Hi,

I need help in this small convert and cast error

DECLARE @P AS int
DECLARE @S AS int


SET @P = 3
SET @S = 0
exec('SELECT CONVERT(DECIMAL(' +cast( @P as varchar) + ',' + cast(@S as varchar) + '), RTRIM(LTRIM(''123.3'')))')

I am getting "Incorrect syntax near 'cast'".

Thanks"

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-06-21 : 06:48:42
Read this topic
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=51356

Madhivanan

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

- Advertisement -