RUNNING AN SP IN ANOTHER DB WITH ANOTHER LOGIN

  • Hi, guys:

    It's a place to meet you again.

    I have the following problem. I have one sp in one database and I log into this database with a user and a password. Then I want to execute another sp that is into another database and the user I'm logged on in the first database doesn't exists in the second one.

    Is it possible to run this second stored procedure without closing my current session. I mean, the query should look something like this:

    execute sp_mysp

    GO

    LOG INTO THE OTHER DATABASE ...

    GO

    RUN THE OTHER SP ...

    LOG OFF (or whatever goes here...)

    I don't know if this is possible in SQL. Please help me...

  • Check out OPENDATASOURCE in BOL.

    _____________
    Code for TallyGenerator

  • Hi sergiy...

    Thanks for the help, it was really helpful. What do you mean with BOL? Forgive my ignorance but I'm not very well in SQL gergon...

  • BOL is Book-On-Line, "Help" for SQL Server.

    Press F1 in EM or QA and you are there.

    _____________
    Code for TallyGenerator

Viewing 4 posts - 1 through 4 (of 4 total)

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