Jan
03
2006

Executing Stored Procedures within Stored Procedures (sprocs)

Is it possible to execute a stored procedured within another stored procedure? According to this thread, it appears so. I’ll have to try it out.

Within a stored procedure, you can execute a stored procedure via EXEC OwnerName.StoredProcedureName. Check SQL Server Books Online for details on executing stored procedures. If the stored procedure returns a result set, then you can:

CREATE TABLE #Temp…
INSERT INTO #Temp…
EXEC dbo.SP1 @parm1 = 10

DROP TABLE #Temp

Tara Kizer
aka tduggan

Written by Tom in: SQL Server |

1 Comment »

  • Tom

    I found a better way to do what I wanted. I realized you can use an inline table-value user-defined function as long as the code is not updating any permanent tables.

    User-defined Functions

    Comment | January 5, 2006

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress | Aeros Theme | TheBuckmaker.com WordPress Themes