Solved

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

Posted on 2010-11-12
6
632 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
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

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.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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.

734 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