我試圖在數據庫之間傳輸數據,但無法使INSERT工作。INSERT命令在SQL Server管理工作室
USE [db1_Name]
GO
INSERT INTO [dbo].[company$Customer]
[No_]
GO
USE [db2_Name]
GO
SELECT
[No_]
FROM [dbo].[company$Customer]
GO
我試圖在數據庫之間傳輸數據,但無法使INSERT工作。INSERT命令在SQL Server管理工作室
USE [db1_Name]
GO
INSERT INTO [dbo].[company$Customer]
[No_]
GO
USE [db2_Name]
GO
SELECT
[No_]
FROM [dbo].[company$Customer]
GO
你的腳本改爲
INSERT INTO DbnameTarget.[dbo].[company$Customer]
SELECT
Colum1,Colum2
FROM DbnameSource.[dbo].[company$Customer]
用自己的
謝謝!不幸的是,在一天結束時,這不是我正在尋找的命令!這實際上是我需要使用的更新。無論如何,感謝您的幫助:) – 2014-10-08 09:40:29
Select * into [DestinationDB].dbo.tableName
from [SourceDB.dbo].SourceTable
(或) SELECT *成[Destinationserver] [DestinationDB] .dbo.tablename更換Dbnames,colums from [Sourceserver]。[SourceDB] .dbo.tablename
可能與http: //stackoverflow.com/questions/7554157/select-into-statement-where-source-is-other-database。 – 2014-10-08 08:40:34
'insert into [db1_name]。[dbo]。[company $ Customer] select [No_] from [db2_Name]。[dbo]。[company $ Customer]' – 2014-10-08 08:42:14