Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Vack
Aged Yak Warrior
530 Posts |
Posted - 2011-02-28 : 11:07:42
|
| I'm working with two tables that are identical. A current table and history table. Trying to import the current table and append to the history table. The import fails because of a duplicate key. The key it is failing on is the records unique ID. If I look at the current tables ID for a record and query that ID in the history table the records are different. Is there a way to have the DTS create a new ID for the record when it is imported? |
|
|
mikgri
Starting Member
39 Posts |
Posted - 2011-03-01 : 15:30:49
|
| Yes you can write a query for insert, in DTS check "Write a query to specify the data to transfer" option and populate new id's.It seems that you have duplicates in your tables, try this:select a.* from table1 a inner join table2 b on a.id=b.idto find out if there are duplicates in tables. |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|
|