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 - 2002-05-14 : 10:50:02
|
| DeLeon writes "I did have a question for you. I wanted to know how do you call a stored proc from another stored proc? I have several stored proc that perform functions I'd like to reuse. I particular, I'd like to know how do I call a stored proc that returns both a recordset or single row from another stored procedure. This would be on the same machine in the same database. Also, how to I use the parameters or recordsets in the caller to execute more sql statement. I've looked quite a few places and have come up empty on how to accomplish this. Your help would be greatly appreciated." |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2002-05-14 : 11:18:35
|
create proc examplea @outparm int outasset @outparm = 1gocreate proc examplebasselect 'Hullo, mommie'unionselect 'its page'gocreate proc examplecasdeclare @exampleaoutput intcreate table #exampleboutput ( examplebcol varchar(20) )exec examplea @outparm = @exampleaoutput outselect @exampleaoutputinsert #exampleboutputexec examplebselect * from #exampleboutputgoexec examplec <O> |
 |
|
|
|
|
|