Re: Creating custom Primary Key in SQL Server 2005
- From: AMD_GAMER <amdgamer18@xxxxxxxxx>
- Date: Tue, 11 Mar 2008 20:11:20 -0700 (PDT)
Actually, I am in contact with the Accounting Department. The
university uses the scheme for identifiers as:
2 digits for the year, followed by 2 digits for the # of the grant
assigned for that year (will be increasing to 3).
Also, I have found out that a PK as an integer drops leading zeros,
so I think the PK will need to follow the format:
4 digits for year, followed by 3 digits for the # of grant for that
year. (Ex: 2008001)
How would I go about retrieving the last 3 digits from the column in
the table and have it increment by 1? So, the next grant would be
(2008002). I can calculate the year very easily through C#.
.
- Follow-Ups:
- Re: Creating custom Primary Key in SQL Server 2005
- From: --CELKO--
- Re: Creating custom Primary Key in SQL Server 2005
- From: Tom van Stiphout
- Re: Creating custom Primary Key in SQL Server 2005
- References:
- Creating custom Primary Key in SQL Server 2005
- From: AMD_GAMER
- Re: Creating custom Primary Key in SQL Server 2005
- From: Erland Sommarskog
- Re: Creating custom Primary Key in SQL Server 2005
- From: AMD_GAMER
- Re: Creating custom Primary Key in SQL Server 2005
- From: --CELKO--
- Creating custom Primary Key in SQL Server 2005
- Prev by Date: Re: concurrency problem with lists ("check constraint" on groups of rows)
- Next by Date: Re: Name value pair
- Previous by thread: Re: Creating custom Primary Key in SQL Server 2005
- Next by thread: Re: Creating custom Primary Key in SQL Server 2005
- Index(es):
Relevant Pages
|
Loading