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 - 2003-06-04 : 07:36:37
|
| Bret writes "I have created a stored procedure that uses a complex algorithm to calculate what the team & shift should be given any date/time. I need to create a new stored procedure to update the team/shift in a table every 12 hours and would like to reuse code by executing the stored procedure from within another stored procedrue or select statement, is this possible?SELECT * FROM [stored_procedure]The stored procedure will use the GETDATE() if no date/time is supplied...Thanks for your help!Bret HillDBA/Web App DeveloperOcean Spray Cranberries" |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2003-06-04 : 08:28:12
|
| Create a temp table with the exact structure of the rowset generated by your stored procedure. Then use the INSERT ... EXEC ... syntax to pump the proc's rowset into your temp table.If you are on SQL2K, you may be able to convert the logic in your proc into a table-valued user-defined function.Jay White{0} |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2003-06-04 : 12:19:38
|
quote: Bret writes ...
I did like hell.. INSERT INTO myTable(col1, col2, ect*) EXEC mySprocNumber of columns returned from the procedureBrett8-)Edit: and it's 2 t's, not one... Edited by - x002548 on 06/04/2003 12:20:27 |
 |
|
|
|
|
|