Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
daniel.newman@bis-web.net
Yak Posting Veteran
71 Posts |
Posted - 2001-08-09 : 10:28:21
|
| Hello all,I have the following table structure#TaskID bigint X#PlanNo varchar(10) XStatus char(1) XTaskDesc varchar(255) XTaskInfo varchar(4000)RTO int XThe hashs indicate primary keys, and the X's are for not null columns.I thought that by having the primary key assigned to two columns, the identity would work differently. What I would like, is for every PlanNo to keep an incremental count, but whenever a new PlanNo is inserted, then the identity is set to 1 for that PlanNo. I could do this by having another table handling the numbers, but wondered if there was an easier way of doing it?So I could have the following PK's:1 BCB0182 BCB0183 BCB0181 RFX0052 RFX0053 RFX005And the next Insert of a Task for BCB018 would have a TaskID of 4. Is this possible?Daniel Newman. |
|
|
|
|
|