Linked Server MERG Data

  • How do I insert selected data from a linked server and insert it into the destination server?

    For example:

    I have a Table called Employee_Table in a remote SQL database named DatabaseSource (Linked Server named LinkedServer).

    The Columns in Employee_Table are named columns EmployeeID (Value Number, 4), Employee FirstName, EmployeeLastName, ColumnNameA, ColumnNameS, ColumnNameD, ColumnNameD.

    So I have this:

    SELECT EmployeeID , Employee FirstName, EmployeeLastName, ColumnNameA,ColumnNameS, ColumnNameD,ColumnNameD

    FROM LinkedServer.DatabaseSource. Employee_Table

    Now how do I insert using the same query using MERGE to insert only new data from LinkedServer.DatabaseSource. Employee_Table?

    (The destination data base named DestinationDatabase, destination table named Employees.)

    INSERT INTO DestinationDatabase. Employees

    The columns in Employees are named EmployeeNum (value Number, (prefix of 000000)10), EmployeeName, ColumnName1, ColumnName2, ColumnName3.

    Now how do I schedule this to run as a weekly Job on every Sunday at midnight?

  • duplicate post.

    no need to cross post to multiple forums it fractures the answers you get and makes posters duplicate others work.

    the "Recent Posts" link shows us everything.

    continue the thread here:

    Linked Server MERG Data

    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 2 posts - 1 through 1 (of 1 total)

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