Identity Changes

  • I have a table called EligibilityErrors, multiple columns (more than in the example). When the key changes (DocumentKey + staging_id), I'd like an identity field to restart at 1. The identity column would be an add-on to an existing table.

    Ex:

    DocumentKey Staging_Id Identityfield

    12345 1 1

    12345 1 2

    12345 1 3

    12346 1 1

    12346 1 2

    , etc.

    Is there an easier way to do this than coding something up within the application (as it's a canned app, obviously we want to keep customizations to a minimum)? Thanks for any suggestions.

    -- You can't be late until you show up.

  • You can reset an identity column by running DBCC CheckIdent('table', Reseed, Seed value). I suppose you might be able to put a trigger on the table to reset the identity value. I'd be more inclined to have a counter stored in a table in this instance.

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

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