Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2003
    Posts
    1

    Unanswered: Copy data between DB with DTS

    Hi,

    My problem is regarding copy data between two databases with an DTS package.
    I have two DB, DB1 and DB2 and they both contains a tbl
    named companies. Every week new companies is added two DB1
    and I want a DTS package to copy that new data to DB2.
    The problem is that I only wants to copy new data, otherwise I get a primary key violation. You can't add a company with the same key as another.

  2. #2
    Join Date
    Dec 2002
    Posts
    1,245

    Re: Copy data between DB with DTS

    Lookup Data Driven Query task in SQL BOL. It will allow you to check for the existence of a record on the target server and skip that record when processing. It's a little complex to use, but it works well.

    One more caution, since it is a script-driven task, you may experience performance issues with very large record sets.

    You may also consider using straight T-SQL and not use DTS at all. Even if the two databases are are separate servers, you can link them and use T-SQL.

    Regards,

    Hugh Scott

    Originally posted by jrundber
    Hi,

    My problem is regarding copy data between two databases with an DTS package.
    I have two DB, DB1 and DB2 and they both contains a tbl
    named companies. Every week new companies is added two DB1
    and I want a DTS package to copy that new data to DB2.
    The problem is that I only wants to copy new data, otherwise I get a primary key violation. You can't add a company with the same key as another.

  3. #3
    Join Date
    Feb 2003
    Posts
    8

    Wink Re: Copy data between DB with DTS

    You can use query statement to copy the data into db2.

    Originally posted by jrundber
    Hi,

    My problem is regarding copy data between two databases with an DTS package.
    I have two DB, DB1 and DB2 and they both contains a tbl
    named companies. Every week new companies is added two DB1
    and I want a DTS package to copy that new data to DB2.
    The problem is that I only wants to copy new data, otherwise I get a primary key violation. You can't add a company with the same key as another.

  4. #4
    Join Date
    Jul 2003
    Posts
    1

    Re: Copy data between DB with DTS

    Originally posted by jrundber
    Hi,

    My problem is regarding copy data between two databases with an DTS package.
    I have two DB, DB1 and DB2 and they both contains a tbl
    named companies. Every week new companies is added two DB1
    and I want a DTS package to copy that new data to DB2.
    The problem is that I only wants to copy new data, otherwise I get a primary key violation. You can't add a company with the same key as another.
    Hi,

    i can recommend a tool for this problem:
    http://www.sqlscripter.com

    Regards
    Thomas

Posting Permissions

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