BoulderBum
Programmer
I have a table with the key:
PK id_num
PK sequence_num
Basically, for each ID, there can be 0 to N records in the table, but I'd like the sequence value to be, well, sequential, like:
id_num = 090
sequence_num = 1
id_num = 090
sequence_num = 2
etc.
In other words, I don't want the sequence numbers to jump from 1 to 5 or something.
Is there a way to set up this constraint in SQL Server, or do I need to do this programmatically?
PK id_num
PK sequence_num
Basically, for each ID, there can be 0 to N records in the table, but I'd like the sequence value to be, well, sequential, like:
id_num = 090
sequence_num = 1
id_num = 090
sequence_num = 2
etc.
In other words, I don't want the sequence numbers to jump from 1 to 5 or something.
Is there a way to set up this constraint in SQL Server, or do I need to do this programmatically?