SSIS w/Identity column

  • Hi,

    If I have to load file(s) nightly via SSIS scripts how does this impact an identity(1,1) field? Would the value just keep increasing? 

    Some of the files would be pretty big upwards of a few 100k rows. These would be nightly extracts from another system where records may or may not have changed from previous night.

    thanks in advance.

  • This would depend on a number of things, if you TRUNCATE the table before loading, this resets the identity value back to its initial value.  You could manually reset the identity column as well if needed.  There are also options that let you explicitly set the value of the identity column if it's in the file you are loading.  If you just keep adding more records every time your package runs, or do DELETE instead of TRUNCATE, then yes the identity column would just keep increasing until it ran out of values.

  • Chris Harshman - Wednesday, April 19, 2017 1:50 PM

    This would depend on a number of things, if you TRUNCATE the table before loading, this resets the identity value back to its initial value.  You could manually reset the identity column as well if needed.  There are also options that let you explicitly set the value of the identity column if it's in the file you are loading.  If you just keep adding more records every time your package runs, or do DELETE instead of TRUNCATE, then yes the identity column would just keep increasing until it ran out of values.

    This helps. Thanks Chris!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply