By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
462,871 Members | 654 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 462,871 IT Pros & Developers. It's quick & easy.

Working With Two Different Stored Procedures from Different Databases in Sql Server

P: 14
I'm having Two Stored Procedures in Two Different Databases..

Database1 - Employee
Stored Procedure - Employee_Details

Database2 - Company
Stored Procedure - Company_Details

In Each Stored Procedure I Joined Three Tables(Inner Join) in both the Databases..

Now I want to Join these Two Stored Procedures from Different Databases to get My Result..

How to do this..

Thank You
Feb 25 '08 #1
Share this Question
Share on Google+
3 Replies

Expert 100+
P: 759
Output the 2 sp results into a temp table via a Cursor and then make the recordset available from the #temp table

Then Delete that #temp table.
Feb 25 '08 #2

Expert 5K+
P: 8,127
You can't join stored procedures.

Please follow as suggested in previous post.
Feb 25 '08 #3

Expert 2.5K+
P: 2,878
Try to use table function for your stored proc. That way both will return resultset that you can join.

-- CK
Feb 25 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.