Update a data from one database server to another database server

  • Need some help... the statement below works with in a database (lets say my localserver)

    UPDATE Dev.dbo.table SET ControlNumber = T.ControlNumber

    FROM Temp.dbo.temptable T

    WHERE Dev.dbo.table.OperatorControlNumber = T.OperatorControlNumber

    From my Localserver(Treat this as tempDB) i need to update the Controlnumbers to Development box.

    UPDATE SERVER.Dev.dbo.table SET ControlNumber = T.ControlNumber

    FROM SERVER.Temp.dbo.temptable T

    WHERE SERVER.Dev.dbo.table.OperatorControlNumber = T.OperatorControlNumber

    i get an error ...The number name 'SERVER.DEV.dbo.table' contains more than the maximum number of prefixes. The maximum is 3.

    I understand the error ... is there another way of doing this?

    Please help i need to run this ASAP ... Have a DEADLINE to meet.

    Thank you

    S.R

  • Do you have a linked server set up?

  • How can you tell if a Server is Linked or Remote Server?

    I think its Remote server but not sure

    Thanks SR

  • I think i need to Create a linked database ..but dont know how to do it?

    sr

  • Did you or someone else go through the process of setting up a linked server? Remote Servers are being phased out in favor of Linked Servers.

    Which server are you writing the update statement on, your server or the development box? I would try writing the query this way, on my local box:

    Update Dest

    SET ControlNumber = T.ControlNumber

    From

    [remote_server].Dev.dbo.table as Dest Join

    Temp.dbo.temptable as T On

    Dest.OperatorControlNumber = T.OperatorControlNumber

    You need to have the remote server setup to allow data access and allow RPC. Also the user setup for access to the remote server needs to have update rights on the destination table.

  • sr (3/4/2008)


    I think i need to Create a linked database ..but dont know how to do it?

    sr

    Lookup linked server in Books On Line or google it.

  • will have to run the script from my server (local box)

    Update from my local box ( SSS) to Development box (RRR).

    --

    do you mean that if the servers are linked only then this update will take place?

    --

    Thanks 4 repl'n

  • Again, see Jack's posts (linked servers is probably your easiest solution). After an honest attempt, post any issues you may have and you'll find plenty of help.

    -- You can't be late until you show up.

Viewing 8 posts - 1 through 7 (of 7 total)

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