| How to
transfer data between linked servers? |
|
Execute the following
SQL Server T-SQL script with four-part addressing in SSMS Query Editor to transfer data
from one linked server to another by appending. SalesOrderDetailID
is automatically generated at target server:
USE AdventureWorks2008;
INSERT INTO [40.116.114.48].[AdventureWorks2008].[Sales].[SalesOrderDetail]
([SalesOrderID]/* ,[SalesOrderDetailID] */
,
[CarrierTrackingNumber],
[OrderQty],
[ProductID],
[SpecialOfferID],
[UnitPrice],
[UnitPriceDiscount],
[LineTotal],
[rowguid],
[ModifiedDate])
SELECT [SalesOrderID]/* ,[SalesOrderDetailID] */
,
[CarrierTrackingNumber],
[OrderQty],
[ProductID],
[SpecialOfferID],
[UnitPrice],
[UnitPriceDiscount],
[LineTotal],
[rowguid],
[ModifiedDate]
FROM [20.156.44.88].[AdventureWorks2008].[Sales].[SalesOrderDetail]
WHERE YEAR(ModifiedDate) = 2008;
Related link:
http://msdn.microsoft.com/en-us/library/ms190479.aspx
|
| |
| SQLUSA.com
Home Page |
|
|
SQL Server Training at www.sqlusa.com.
Microsoft SQL Server 2012 Training Videos at www.sqlusa.com.
SQL Server 2008 Video Training at www.sqlusa.com.
SQL Server 2005 Training Videos at www.sqlusa.com.
|
|
|
FREE SS SQL / BI OLAP Short Videos on YOUTUBE.com |
|
Search SQLUSA FREE SQL Server Articles & FREE T-SQL Scripts |
Copyright 2005-2012, SMI Corp. All Rights Reserved.
SQL Server 2012 is a program product of Microsoft Corporation. SQL Server 2008 is a program product of Microsoft Corporation. SQL Server 2005 is a program product of Microsoft Corporation. SQL Server 2000 is a program product of Microsoft Corporation. |
|