SQL syntax help

  • Could someone tell me how to run a procedure on a Remote Database please.

     

    Thanks in advance

     

     

  • exec dbname.dbo.spname

  • sorry, I forgot to say, the Remote database is on a seperate server.

  • check out sp_addlinkedserver in BOLS.

  • you would do this:

    Execute servername.databasename.ownername.procedurename

     

    then pass parameters like you normally would

  • Prior to that you need to setup a linked server to use a 4 part objectname. I believe that OPENQUERY does not have that prerequisite. Check out BOL for:

    Linked Server

    OPENQUERY

    RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."

Viewing 6 posts - 1 through 5 (of 5 total)

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