i have a problem on how to code for automatic generate an employee id whenever i registered an account in my system. i used asp.net as my front end and Sql Server Database 2005 as my back end.. thnx a lot!
richjohn.bulante
0
Newbie Poster
Recommended Answers
Jump to Postsql databases can generate the numbers for you, just make one of the columns auto increment.
Jump to Postis the FHMS a static string and the user id based on month day year? I see the 12 and instantly think date codes.
If you want random strings you could generate the id then query the database to see if that key is unique. But that would lead to …
Jump to Postselect 'FHMS' + max(SUBSTRING ( employeeId ,5 , 5 ))+1 as nextkey from employeemaster I hope This is the query you are looking for
All 10 Replies
JorgeM
958
Problem Solver
Team Colleague
Featured Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
richjohn.bulante
0
Newbie Poster
dioioib
4
Light Poster
urtrivedi
276
Nearly a Posting Virtuoso
richjohn.bulante
0
Newbie Poster
richjohn.bulante
0
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
urtrivedi
276
Nearly a Posting Virtuoso
sandeepmittal11
0
Newbie Poster
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.