Wednesday, March 7, 2012

Importing Data (Overwrite Any Existing Records)

Good Morning, I need some assistance with SQL Server 2000 Importing Data.

When I import data from a text on a routine basis, three things must happen:

1. New records identified by primary key get appended to table.

2. Exisiting records identified by primary key get overwritten with new/(updated) data.

3. All other existing records are left alone.

Does anyone know how to Import Records with the following the criteria above? It cannot insert duplicate primary keys by nature, so it must overwrite those records!

This is being built into a DTS Package, but I need to get over this obsticle! Thanks for any guidance!

Any thoughts, ideas, or suggestions?|||

Hi,

When you create a DTS package in the designer in SQL 2000, open the properties windows of a transfer.

In Option tab, there is a Enable Identity Insert option. You can check it to make DTS overwrite all the rows that have same identity as the source table.

HTH. If this does not answer your question, please feel free to mark the post as Not Answered and reply. Thank you!

No comments:

Post a Comment