Keyboard Face
msgbartop
when you find QWERTY imprinted on your cheek – it’s time to go to bed.
msgbarbottom

03 Jan 06 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

Share and Enjoy:
  • del.icio.us
  • digg
  • Furl
  • NewsVine
  • RawSugar
  • Reddit
  • Spurl
  • YahooMyWeb

For more information, visit Dianetics.org

Reader's Comments

  1. |

    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



Leave a Comment