How can I copy data records between two instances of an SQLServer database

后端 未结 4 1756
闹比i
闹比i 2020-12-14 00:28

I need to copy some records from our SQLServer 2005 test server to our live server. It\'s a flat lookup table, so no foreign keys or other referential integrity to worry ab

相关标签:
4条回答
  • 2020-12-14 01:01

    I would just script to sql and run on the other server for quick and dirty transferring. If this is something that you will be doing often and you need to set up a mechanism, SQL Server Integration Services (SSIS) which is similar to the older Data Transformation Services (DTS) are designed for this sort of thing. You develop the solution in a mini-Visual Studio environment and can build very complex solutions for moving and transforming data.

    0 讨论(0)
  • 2020-12-14 01:07

    An SSIS package would be best suited to do the transfer, it would take literally seconds to setup!

    0 讨论(0)
  • 2020-12-14 01:17

    If your production SQL server and test SQL server can talk, you could just do in with a SQL insert statement.

    first run the following on your test server:

    Execute sp_addlinkedserver PRODUCTION_SERVER_NAME
    

    Then just create the insert statement:

    INSERT INTO [PRODUCTION_SERVER_NAME].DATABASE_NAME.dbo.TABLE_NAME   (Names_of_Columns_to_be_inserted)
    SELECT Names_of_Columns_to_be_inserted
    FROM TABLE_NAME
    
    0 讨论(0)
  • 2020-12-14 01:19

    I use SQL Server Management Studio and do an Export Task by right-clicking the database and going to Task>Export. I think it works across servers as well as databases but I'm not sure.

    0 讨论(0)
提交回复
热议问题