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 2000 Forums
 SQL Server Development (2000)
 Inserting same usernames with a integer suffix

Author  Topic 

akpaga
Constraint Violating Yak Guru

331 Posts

Posted - 2009-05-26 : 22:55:28
Hi

i have customer table with username field

what i want to do is when a customer enters his firstname and last name from the front end , i would create a username based on the firstname ,lastname

ex:
John Carpenter then username is johnC since the username should not exceed 8 characters . If JohnC already exists the it is should insert JohnC1
and if johnc1 exists JohnC2....

If user firstname is jennifer lastname: Houston

then username is JennifeH removing r from jennifer but if that already exists then jennifH . It should again check for to see if jennifH exists . If yes the it adds JennifH2...so on.

the main criteria is that the username should be only 8 characters.


Hope i am clear .

thank you in advance ....

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-05-27 : 09:59:28
If it is possible - do it in the fron end.

Webfred


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -