Share via

import data from another server

Winston TheFifth 106 Reputation points
2022-03-23T15:29:17.517+00:00

How do you import data from querying data on server1 to a table on server2 in SSIS?

SQL Server Integration Services
Developer technologies | Transact-SQL
Developer technologies | Transact-SQL

A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.

0 comments No comments

4 answers

Sort by: Most helpful
  1. Ronen Ariely 15,221 Reputation points
    2022-03-24T01:48:54.857+00:00

    Here are some more options in addition to @ZoeHui-MSFT solution of using SSDT or SSIS or direct query

    (1) Use bcp to export the data to csv file and import the data to the other server - this is my preferred option for many cases

    (2) Use merge replication - fits mostly when this is not a one time work but a case that you want to keep the tables sync

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

  2. Olaf Helper 47,621 Reputation points
    2022-03-24T09:56:57.687+00:00

    How do you import data from querying data on server1 to a table on server2 in SSIS?

    With a data flow task and OleDB data source and destination, see https://learn.microsoft.com/en-us/sql/integration-services/control-flow/data-flow-task?view=sql-server-ver15

    Was this answer helpful?

    0 comments No comments

  3. ZoeHui-MSFT 41,551 Reputation points
    2022-03-24T01:28:27.837+00:00

    Hi @Winston TheFifth

    If you had configure server2 as linked server on the server1, you can run the following statement inside stored proceduce to copy table data.
    Insert Into Server2.Database2.dbo.Table2 (Cols)
    Select Cols From Server1.Database1.dbo.Table1

    Or you can use the SQL Server Import and Export Wizard to export the data from server1 to server2, save the SSIS package created by the wizard on the SQL Server, create a job to run the SSIS package.

    import-and-export-data-with-the-sql-server-import-and-export-wizard

    Regards,

    Zoe


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?


  4. Winston TheFifth 106 Reputation points
    2022-03-23T15:47:01.56+00:00

    ado.net worked

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.