Running A SP on a different Db

  • Hi All,

    i was wondering if it is possible to run a Stored Procedure from DB1 on Machine1 on a table in DB2 on Machine2 in SQL Server2000? Both machines have access to each other but are on seperate vlans of our network. i have an outside app running to Machine1 and Machine1 will connect to Machine2. Any Thoughts?

    Thanks in Advance

    Chris 

  • EXEC SERVERNAME.DATABASENAME.OBJECTOWNERNAME.STOREDPROCEDURENAME

    Hope that hepls...

  • You might need to use:

    sp_addlinkedserver - to make the other server visible

     & sp_addlinkedsrvlogin - to authenticate your call

    /HL

     

  • i read the question differently: can you execute sp_whatever, that exists on server1, on server 2.

    my answer is that you must copy the proc to the other server. I think if you call SERVERNAME.DATABASENAME.OBJECTOWNERNAME.STOREDPROCEDURENAME

    it will execute on the remote server, and not on the "other' server and database.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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

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