Copy from one DB to another with QA

  • Hello,

    I'm trying to update a column of data my local DB from a table in a database on another server using Query Analyzer. Without using DTS, only SQL in QA, how can I do this ?

    Qualify all objects with:

    [Server].[dbo].table ??

    Any help is appreciated

  • Just got done doing the reverse. Been building a DW on a test server, loading and cleansing the data. Used a linked server to copy the updates.

    Create an ID on the other server with rights.

    Create a Linked Server on the recieving server.

    Then reference to other as server.dbname.dbo.table

    Sometimes you need some of the brackets, sometimes you don't.

    KlK, MCSE


    KlK

  • You can always use the brackets, but if there is not a special character, you won't need it. The name of the server is the name of the linked server (can be different form the real server name.

    INSERT INTO localtable

    SELECT * from [linkedserver].[db].[owner].[remotetable] where <condition>

    I prefer to place all database objects in brackets since there is then no confusion about the object to which I am referring. It also doesn't help that I have several tables I inherited in production that use reserved words for columns.

    M

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

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