Gettign the output of the stored procedure to a query

  • Dear All,

    I have an store procedure which will return the file type rights of the user with one column "FileTypeID" with multiple rows.

    Now i have an another requirement in another stored procedure which will have to take that "FileTypeID" and based on that it has to retrieve the documents in the DB.

    For this I need to know how to assign the output of the stored procedure to

    "IN" clause.

    For e.g.,

    SELECT * FROM Docs WHERE FileTypeID IN ([file types to which the user has the rights which is retrieved from the previous stored procedure]

    Can any one help in this regard?

    Thanks a lot in advance.

    [font="Arial"]Nothing is impossible with Hard Work[/font]:)

  • Hi

    You can insert the result set of a procedures into a table.

    Insert into table1 (col1,col2....)

    Exec StoreProc1 @param1,@param2... .

    "Keep Trying"

  • Dear Chirag,

    Thanks a lot.

    It is working now.

    [font="Arial"]Nothing is impossible with Hard Work[/font]:)

  • Hi

    Glad to help. 🙂

    "Keep Trying"

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply