Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The bad seed
Message
From
30/10/2010 04:16:31
 
 
To
29/10/2010 21:14:09
General information
Forum:
Microsoft SQL Server
Category:
Import/Export
Title:
Environment versions
SQL Server:
SQL Server 2008
Miscellaneous
Thread ID:
01487562
Message ID:
01487569
Views:
57
>DBCC checkident
>(policies, reseed, 251)
>( check with noreseed and it is correct)
>
> ( to be clear, the problem below occurred before testing by inserting a record from my app, so it is not a failure to delete that record or properly reseed etc)
>Do it all over and over again, one time even setting seed to 250. On import first record is still 252.
>I am carefully reseeding and checking seed. App honors seed. Import skips one before starting.
>Is this known behavior and is there a way around it? I suspect it has something to do with the import operation being set-based.
>( bonus question : is there an easy way to increment or decrement the existing identity key in a table by 1 for all pks > 250 - assuming not violating uniqueness )

Just from the description: How about a "Hammer, don't question" approach ?
reseed to 249 before import and wait if a violation occurs ?
Or Import from "Second" record and try to overwrite all fields sitting at 250 ?

regards

thomas
Previous
Reply
Map
View

Click here to load this message in the networking platform