locked
stored proc within stored proc RRS feed

  • Question

  • how to call a stored procedure within a stored procedure?
    • Moved by Tom Phillips Monday, February 7, 2011 2:38 PM TSQL question (From:SQL Server Database Engine)
    Monday, February 7, 2011 6:19 AM

Answers

  • Check for the nested stored procedure topic in BOL .

    Please refer the following link : http://www.sqlservercentral.com/articles/T-SQL/nestingstoredprocedures/998/

    -------------------------------
    Thanks,Suhas V

    • Marked as answer by KJian_ Monday, February 14, 2011 7:13 AM
    Monday, February 7, 2011 6:34 AM
  • CREATE PROCEDURE sp1

    @param INT

    AS

    EXEC sp2 @par1=@param

     

    ---usage

    EXEC sp1 @param =20


    Best Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
    • Marked as answer by KJian_ Monday, February 14, 2011 7:13 AM
    Monday, February 7, 2011 6:37 AM
    Answerer
  • Tha'ts pretty straight forward to create stored procs that calls another stored proc

    create proc SP1
    as
    exec sp_who2


    Thanks, Leks
    • Marked as answer by KJian_ Monday, February 14, 2011 7:13 AM
    Monday, February 7, 2011 6:39 AM

All replies

  • Check for the nested stored procedure topic in BOL .

    Please refer the following link : http://www.sqlservercentral.com/articles/T-SQL/nestingstoredprocedures/998/

    -------------------------------
    Thanks,Suhas V

    • Marked as answer by KJian_ Monday, February 14, 2011 7:13 AM
    Monday, February 7, 2011 6:34 AM
  • CREATE PROCEDURE sp1

    @param INT

    AS

    EXEC sp2 @par1=@param

     

    ---usage

    EXEC sp1 @param =20


    Best Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
    • Marked as answer by KJian_ Monday, February 14, 2011 7:13 AM
    Monday, February 7, 2011 6:37 AM
    Answerer
  • Tha'ts pretty straight forward to create stored procs that calls another stored proc

    create proc SP1
    as
    exec sp_who2


    Thanks, Leks
    • Marked as answer by KJian_ Monday, February 14, 2011 7:13 AM
    Monday, February 7, 2011 6:39 AM