我正在尝试在数据库之间传输数据,但无法使INSERT工作。
USE [db1_Name]
GO
INSERT INTO [dbo].[company$Customer]
[No_]
GO
USE [db2_Name]
GO
SELECT
[No_]
FROM [dbo].[company$Customer]
GO
答案 0 :(得分:2)
将脚本更改为
INSERT INTO DbnameTarget.[dbo].[company$Customer]
SELECT
Colum1,Colum2
FROM DbnameSource.[dbo].[company$Customer]
用自己的
替换Dbname,列答案 1 :(得分:0)
Select * into [DestinationDB].dbo.tableName
from [SourceDB.dbo].SourceTable
(或) select * into [Destinationserver]。[DestinationDB] .dbo.tablename 来自[Sourceserver]。[SourceDB] .dbo.tablename