October 1, 2008 at 2:19 pm
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.
October 1, 2008 at 2:37 pm
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.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply