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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 identity seed with leading zeros?

Author  Topic 

burwelj
Starting Member

4 Posts

Posted - 2007-07-12 : 16:52:38
Is is possible to have an identity seed with leading zeros? If so, how do you do this?

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-07-12 : 16:56:29
what do you mean?

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-07-12 : 16:57:25
That is not possible since the data type must be in the numbers family. If you want something like 01, 02, 03, then you need to use varchar and you'll have to code for the increments.

Tara Kizer
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

burwelj
Starting Member

4 Posts

Posted - 2007-07-12 : 17:02:33
thanks tkizer, thats the info i was looking for.
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-07-12 : 18:23:45
you still can use numbers if you want and during presentation of the number, append the leading zeroes that you required.


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2007-07-13 : 00:41:28
this might help:

http://www.sqlteam.com/article/custom-auto-generated-sequences-with-sql-server


elsasoft.org
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-07-13 : 03:05:21
or
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=57069

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -