Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I Want the ID no in that format
E001
E002
E003

but it in auto increment not to insert by user?
Posted

 
Share this answer
 
Read this article: http://www.sqlteam.com/article/custom-auto-generated-sequences-with-sql-server[^]
Concentrate on option 2 (Make it a presentation issue)...
All the difference between your line of identifiers between a identity field is the preceding E letter and the fact that you pad your number with leading zeroes to a fixed length...
That's only a visual representation and not really add to the uniqueness of the number - it means that if you remove those parts (E and leading zeroes) you still have a unique number...
My suggestion is to go with such a solution - use identity column and format it when presenting to end user...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900