x
login about faq Site discussion (meta-askssc)

custom numbering field based on year sql 2008

i would like to have a field that will be primary key for the table and to have the format yyyy/0000000
Each year i want to start over from the 0000001
e.g

2010/0000001, 2010/0000002, 2010/0000003, 2010/0000004, ....
2011/0000001, 2011/0000002, 2011/0000003, 2011/0000004, ....
2012/0000001, 2012/0000002, 2012/0000003, 2012/0000004, ....

can i have your help??

more ▼

asked Aug 03 '12 at 10:34 AM in Default

yiotaa gravatar image

yiotaa
0 1

(comments are locked)
10|1200 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x1601

asked: Aug 03 '12 at 10:34 AM

Seen: 220 times

Last Updated: Aug 03 '12 at 10:47 AM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.