I have two server, srv1 and srv2.
I want to do something like this:
begin tran
declare @.user_id uniqueidentifier
set @.user_id = someid
insert into srv1.Customers.dbo.table1 (field-list)
select (field-list)
from srv2.Customers.dbo.table1
where user_id = @.user_id
insert into srv1.Customers.dbo.table3 (field-list)
select (field-list)
from srv2.Customers.dbo.table2
where user_id = @.user_id
insert into srv1.Customers.dbo.table3 (field-list)
select (field-list)
from srv2.Customers.dbo.table3
where user_id = @.user_id
commit tran
Can it be done by using DTS? I don't have much experience on programming DTS. But I think DTS should be good to do this
kind of stuff. If it can, will this DTS job affect the performance
of other applications who access these two DB, like normal import
data by using the wizard?
Can somebody give me some directions?
Thank you in advance!!You can definately do this in DTS or in SQL if you wish. Don't know if I would include all of those inserts in one transaction though as it will hold locks for longer than needed. If you run this in SQL you need to set up the remote servers as linked servers.|||to use DTS for this particular case?|||I don't see an advantage, it is easier to pass params to SQL rather than DTS.
Friday, February 17, 2012
Data import
Labels:
database,
import,
microsoft,
mysql,
oracle,
server,
someidinsert,
sql,
srv1,
srv2,
thisbegin,
trandeclare,
uniqueidentifierset,
user_id
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment