I want to create a custom identity column or at least a way of setting IDs in my table based on the following format:
YYYYDDDXXXXX
YYYY = Four digit year
DDD = the day of the year, in numeric form
XXXXX = an incremental integer that restarts at 00001 every day.
So, on January 1, 2007, I would have a range of 200700100001 that goes up to 200700199999. When January 2, 2007 comes around, the numbers would start over, 200700200001 to 200700299999.
How can I accomplish this in SQL Server 2005?
Thanks!
Drew
YYYYDDDXXXXX
YYYY = Four digit year
DDD = the day of the year, in numeric form
XXXXX = an incremental integer that restarts at 00001 every day.
So, on January 1, 2007, I would have a range of 200700100001 that goes up to 200700199999. When January 2, 2007 comes around, the numbers would start over, 200700200001 to 200700299999.
How can I accomplish this in SQL Server 2005?
Thanks!
Drew