[thelist] SQL 2000 auto create ID's

Jay Blanchard jay.blanchard at niicommunications.com
Wed Aug 14 08:50:01 CDT 2002


[snip]
I want SQL 2000 to automatically create unique ID's and passwords for users
to have access to a website.
They go to one site, sign up, that then allows them access to a different
site, with this new ID and password.
(currently, we are creating the ID's and passwords manually and email
notifications are sent out using CDONTS).

Each unique ID must start with 'AB'.
Then I want to add after the 'AB' seven random alpha and/or numeric
characters.

The password can be anything, six characters.

Any suggestions for resources, sample scripts? Or even someone in Toronto
who wants to earn some extra money?
[/snip]

SQL 2k cannot do this well, but there is another option which I have used
over time. Your scripting language can do the creation for you, here is an
example in pseudo-code

//--variables received from registration form-->
$userName
$anotherVariableA
$anotherVariableB
// create user ID
$prefix == "AB"
$initials == "process to extract initials from $userName"
$randomNumber == "math to get a 5 digit wide random number"

$userID = $prefix concatenate $randomNumber concatenate $initials
so therefore $userID would be something like AB020359JB

Do something similar with the password.

HTH!

Jay





More information about the thelist mailing list