11/29/2024 8:23:25 AM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss general SalesLogix import and data migration topics. View the code of conduct for posting guidelines.
|
|
|
|
Duplicate ID issue
Posted: 23 Aug 07 2:54 PM
|
Hello,
While running a DTS to import data from a view, I received several duplicate message errors while using the SalesLogix Loader Task in a DTS package. It occurred while loading the Contact Addresses into the Address table. The Loader Task generates ids but in this case it is generating ids that already exist. Is there anything that needs to be done with the SiteKeys table? Or is there something else? This is happening on a recently restored database. It is a copy of our production SalesLogix db.
Thanks.
|
|
|
|
Re: Duplicate ID issue
Posted: 23 Aug 07 9:39 PM
|
Fernando:
I had a quick discussion about this last night with someone else, but here is what's going on:
- The Loader generates the IDs sequentially starting from whichever point the SiteKeys is at So, for instance, if the Sitekeys is set at 1 and you need 5 IDS, it will end up at 6 and you will get IDs 2 thru 6 for your records.
- The ID generation algorithim does not compare each generated ID against the DB, it just works in sequence, so lets say that for any reason whatsoever ID 3 and 4 already exist on the DB, then as the data is being written into the DB the Constraint from the Primary Key will prevent you from inserting the rows.
So, the question is not why the Task Loader is giving you the Duplicate IDs, but rather why are there IDs on the system that shouldn't have existed. One of the reasons why this may be is that someone manually created certain records and used IDs that they thought would never be used, and now you are dealing with the consequences.
How to fix it: - For Each table involved, do a select a Max based on your site code
e.g. SELECT MAX(ADDRESSID) FROM ADDRESS WHERE ADDRESSID LIKE 'a6UJ9%' The value that you retreive will be the highest ID that exist on the DB, now set the Sitekey row for the Address table to a value above the resulting ID.
Now you won't run into this problem (as long as no one is manually generating random IDs or using a failed external process to generate IDs)
|
|
|
|
Re: Duplicate ID issue
Posted: 24 Aug 07 2:20 PM
|
Thanks for the info. I thought it would be something like that. |
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|