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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-04-05 : 08:12:09
|
| venkat writes "When I try to execute this SP, I get the error "Must declare the variable '@return'."This SP compiles without errors, but while executing I get this error.The thing is that I am framing a string and dynamically executing thru exec stmt.can any one throw any ideas on this ..create proc testasbegindeclare @string varchar(100)DECLARE @return varchar(100)select @string = 'exec test1 @return output'print @stringEXEC (@string)end" |
|
|
ijprasad
Starting Member
29 Posts |
Posted - 2005-04-05 : 08:39:13
|
| the datatype @return defined outside the batch execution from @string values, Hence it gives errorTry thiscreate proc testasbegin declare @string varchar(100) select @string = ' DECLARE @return varchar(100) ' + ' exec test1 @return output' print @string EXEC (@string)endInderjeet |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-04-05 : 10:16:09
|
| http://sqlteam.com/forums/topic.asp?TOPIC_ID=47911MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|