Working With Two Different Stored Procedures from Different Databases

  • Hi..,

    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

  • You should use table-valued Functions instead of procedures.

    You can do a simple select on them, use joins and union, ....

    Regerds,

    Denis

  • Correction if you dont' want to change the objects to functions:

    you can always insert resultset of a procedure to table using:

    INSERT INTO table (field1, field2, ....)

    EXEC procedure @param1, @param2, ......

    Create a temp table first and then run the above statment

    Regards,

    Denis

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

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