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 #TempTara Kizer
aka tduggan
Tom says
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