Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Gettign the output of the stored procedure to a query


Gettign the output of the stored procedure to a query

Author
Message
Jaya Chitra
Jaya Chitra
SSC Eights!
SSC Eights! (920 reputation)SSC Eights! (920 reputation)SSC Eights! (920 reputation)SSC Eights! (920 reputation)SSC Eights! (920 reputation)SSC Eights! (920 reputation)SSC Eights! (920 reputation)SSC Eights! (920 reputation)

Group: General Forum Members
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 WorkSmile
ChiragNS
ChiragNS
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2409 Visits: 1865
Hi


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

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

"Keep Trying"
Jaya Chitra
Jaya Chitra
SSC Eights!
SSC Eights! (920 reputation)SSC Eights! (920 reputation)SSC Eights! (920 reputation)SSC Eights! (920 reputation)SSC Eights! (920 reputation)SSC Eights! (920 reputation)SSC Eights! (920 reputation)SSC Eights! (920 reputation)

Group: General Forum Members
Points: 920 Visits: 470
Dear Chirag,

Thanks a lot.

It is working now.

Nothing is impossible with Hard WorkSmile
ChiragNS
ChiragNS
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2409 Visits: 1865
Hi

Glad to help. Smile

"Keep Trying"
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search