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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Aswanth
    New Member
    • Feb 2008
    • 14

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

    Hi..,
    I'm having Two Stored Procedures in Two Different Databases..

    Database1 - Employee
    Stored Procedure - Employee_Detail s

    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
  • radcaesar
    Recognized Expert Contributor
    • Sep 2006
    • 759

    #2
    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.

    Comment

    • debasisdas
      Recognized Expert Expert
      • Dec 2006
      • 8119

      #3
      You can't join stored procedures.

      Please follow as suggested in previous post.

      Comment

      • ck9663
        Recognized Expert Specialist
        • Jun 2007
        • 2878

        #4
        Try to use table function for your stored proc. That way both will return resultset that you can join.

        -- CK

        Comment

        Working...