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)
 return output from dynamic procedure call

Author  Topic 

edpel
Starting Member

22 Posts

Posted - 2003-12-22 : 10:09:36
I need to execute a stored procedure dynamically, then get to the result, what is the best way to accomplish this?

select @sqlSelect = 'Declare @passfail char(6) exec ' + @testname + ' @passfail output'

exec(@sqlSelect)

I need to then get to the @passfail parameter. Should sp_executeSql be used?

Thanks,
Eddie

nr
SQLTeam MVY

12543 Posts

Posted - 2003-12-22 : 10:33:11
Yes

exec sp_executesql @sqlSelect, N'@passfail char(6) out', @passfail out


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

edpel
Starting Member

22 Posts

Posted - 2003-12-22 : 10:39:58
thanks NR, that works great!
Go to Top of Page
   

- Advertisement -