SQL Server identity column and imports -


i'll try , explain in simple terms leaving out whys , wheres of how occured.

currently there 2 databases need merged, have same tables etc , in cases lookup tables identical, in cases , in cases records in 1 database have different identity values there equivalent in other db. it's mess.

let on 1 of databases update identity values bu adding 10,000 them , updating related records. import data , yes in cases lookups have same value twice different identities.

the question not regarding above mess :). want know after re enabling identity column have seed values of

1,2,3,4,5 etc , 10001, 10002, 10003 etc. should more rows inserted , continue lets 9999 identity column use 10,000 , 10,004 or sql server complain on next insert identity value used?

i tested simple insert's: have disable identity_insert first each table want import data

set identity_insert table off 

then can insert data original identity column values (which you'll need in order maintain references correctly)

after

set identity_insert table on 

sql server continues sequence highest element plus one, in case (after inserting ids 10001, 10002, 10003) continue 10004.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -