Is it possible to 'reset' the value of an identity column based on values in another column? Here's an example of the type of data I'm working with and what I'd like to do:
AutoID TeamID
----------- -----------
1 0
2 0
3 0
1 1
2 1
3 1
1 2
2 2
3 2
1 3
Right now, the identity column 'AutoID' is seeded at 1 and incremented at 1 so it keeps a running total of the records. Is it possible to have this field 'reset' itself to 1 everytime the data in the 'TeamID' column changes?
AutoID TeamID
----------- -----------
1 0
2 0
3 0
1 1
2 1
3 1
1 2
2 2
3 2
1 3
Right now, the identity column 'AutoID' is seeded at 1 and incremented at 1 so it keeps a running total of the records. Is it possible to have this field 'reset' itself to 1 everytime the data in the 'TeamID' column changes?