Results 1 to 4 of 4

Thread: Data import

  1. #1
    Join Date
    Apr 2003
    Posts
    30

    Unanswered: Data import

    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!!

  2. #2
    Join Date
    Oct 2001
    Location
    Naples, FL
    Posts
    273
    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.
    ---------------
    Ray Higdon MCSE, MCDBA, CCNA

  3. #3
    Join Date
    Apr 2003
    Posts
    30

    Thanks. Is there any advantage

    to use DTS for this particular case?

  4. #4
    Join Date
    Oct 2001
    Location
    Naples, FL
    Posts
    273
    I don't see an advantage, it is easier to pass params to SQL rather than DTS.
    ---------------
    Ray Higdon MCSE, MCDBA, CCNA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •