Copy table to a different database on a different SQL Server

后端 未结 6 998
心在旅途
心在旅途 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:55

    Yes. add a linked server entry, and use select into using the four part db object naming convention.

    Example:

    SELECT * INTO targetTable 
    FROM [sourceserver].[sourcedatabase].[dbo].[sourceTable]
    

提交回复
热议问题