Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Gettign the output of the stored procedure to a query Expand / Collapse
Author
Message
Posted Monday, May 05, 2008 12:20 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Monday, June 21, 2010 5:29 AM
Points: 920, Visits: 470
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.


Nothing is impossible with Hard Work:)
Post #494792
Posted Monday, May 05, 2008 12:40 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Wednesday, March 19, 2014 1:27 AM
Points: 2,366, Visits: 1,837
Hi


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

Insert into table1 (col1,col2....)
Exec StoreProc1 @param1,@param2... .



"Keep Trying"
Post #494795
Posted Monday, May 05, 2008 3:49 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Monday, June 21, 2010 5:29 AM
Points: 920, Visits: 470
Dear Chirag,

Thanks a lot.

It is working now.


Nothing is impossible with Hard Work:)
Post #494837
Posted Tuesday, May 06, 2008 3:19 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Wednesday, March 19, 2014 1:27 AM
Points: 2,366, Visits: 1,837
Hi

Glad to help. :)


"Keep Trying"
Post #495459
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse