Copy table to a different database on a different SQL Server

后端 未结 6 992
心在旅途
心在旅途 2020-12-01 10:36

I would like to copy a table from one database to another. I know you can easily do the following if the databases are on the same SQL Server.

SELECT * INTO          


        
6条回答
  •  伪装坚强ぢ
    2020-12-01 10:56

    If it’s only copying tables then linked servers will work fine or creating scripts but if secondary table already contains some data then I’d suggest using some third party comparison tool.

    I’m using Apex Diff but there are also a lot of other tools out there such as those from Red Gate or Dev Art...

    Third party tools are not necessary of course and you can do everything natively it’s just more convenient. Even if you’re on a tight budget you can use these in trial mode to get things done….

    Here is a good thread on similar topic with a lot more examples on how to do this in pure sql.

提交回复
热议问题