Solved

Using SSIS to move (not copy!) between to SQL Server instances

Posted on 2010-11-12
6
630 Views
Last Modified: 2012-05-10
Hello,

Is it possible to use SSIS 2005 to move (not copy!) data  between to SQL Server instances?

I am considering to use this technique to archive some large tables from my OLTP DB.

Note: the transfer should be transactional.

Thanks,

PK
0
Comment
Question by:dgb
6 Comments
 
LVL 9

Expert Comment

by:radcaesar
ID: 34118579
Copy the data and then truncate the source table in the next step if the copy was successful.
0
 

Author Comment

by:dgb
ID: 34118604
radcaesar,

I don't want to move all the data in the table, only a part of it. A T-SQL should decide which rows should be moved.

By the way what if the copy was only partly successful? Will a rollback take place?
0
 
LVL 15

Expert Comment

by:AmmarR
ID: 34118777
Dear dgb:

There is no command in SQL server that will move Data from a table to the other

what radcaesar: suggested is right

you need to copy the data you want e.g

Insert into DestTable
Select * from sourcetable
where a = ? --what ever condition

then
do th following

Delete from sourcetable where a = ?

this will in other words move.
-------

and by the way this is the move concept even in windows
its a copy and then delete of source..

0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 6

Expert Comment

by:subhashpunia
ID: 34119204
You can move data from one SQL server to another by two methods:
1. Using four part naming. It would require linked server.
2. SSIS pkag.

As for simple SQL to SQL data tranfer, no ssis specific feature is used so I would prefer to use four part naming method to avoid unnecessary deployment, debugging complexity of SSIS.  
0
 
LVL 7

Accepted Solution

by:
Cboudroz earned 500 total points
ID: 34141625
To have transactional operation in SSIS you can used Container to put many task and put the TransactionOption property of the container to "Required".

used this to move the row :

DELETE dbo.LiveTable
OUTPUT DELETED.*
INTO LINKSERVER.DATABASE.dbo.ArchivesTable
FROM dbo.LiveTable WITH (TABLOCKX)



everything is explain there:
http://www.mssqltips.com/tip.asp?tip=1585
0
 

Author Closing Comment

by:dgb
ID: 34280906
Exactly what I was looking for.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
script to send html report 3 32
Count with a subquery showing details 10 43
export sql results to csv 6 35
MSSQL Import .SQL files - Increase Import Speed 9 35
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question