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 |
|
SQLboom
Yak Posting Veteran
63 Posts |
Posted - 2003-11-17 : 03:53:30
|
| Hi,Can anyone provide the syntax for executing a stored procedure (with parameters) using a variable name, with a return value.E.g. This works fine...declare @procname varchar(10)set @procname = 'procname'Exec @iReturn = @procnameBut when the procedure has parameters, it doesn't declare @procname varchar(10)set @procname = 'procname @param1 = 1'Exec @iReturn = @procnameI need to catch the return value (i.e. @iReturn) after the procedure is executed. Thanks.. |
|
|
rksingh024
Yak Posting Veteran
56 Posts |
Posted - 2003-11-17 : 04:26:00
|
| declare @procname varchar(10)set @procname = 'procname'Exec @iReturn = @procname @param1 = 1Ramesh Singh |
 |
|
|
SQLboom
Yak Posting Veteran
63 Posts |
Posted - 2003-11-17 : 05:50:29
|
| Thanks . . .But my parameter is a also a variable. .. :(. . .how do i do it then. . . |
 |
|
|
rksingh024
Yak Posting Veteran
56 Posts |
Posted - 2003-11-17 : 07:05:28
|
| declare @procname varchar(10), @value intset @procname = 'procname'set @value = 1Exec @iReturn = @procname @param1 = @value orExec @iReturn = @procname @value Ramesh Singh |
 |
|
|
SQLboom
Yak Posting Veteran
63 Posts |
Posted - 2003-11-17 : 10:37:42
|
| Yup!. .. should have got it earlier. . .Thanks a lot ... |
 |
|
|
|
|
|