I was required to have my ID number, which is the primary column of my table, to be formatted with date. Instead of having just a number incremented by 1 (identity(1,1)), I need to have something like 318111 that means March 18, 2011 and the last digit is incremented by 1. How to do this? Do I need to make another column and still keep the identity column?

Better put the logic in a function and call the same to generate the value for the column. Once the date changes it will reset the value.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.