Hi
I've got a table which holds account numbers, usernames and passwords. I already know the account number, but I want to add a username and password. Obviously the username must be unique, and the field is set not to accept duplicates. The username is going to be made out of the user's first initial and surname, plus a number if that username already exists. So we are looking at something like:
jbloggs
jbloggs1
jbloggs2
...etc.
Is there any way I can get SQL to try the insert until it gets a result which works and then return it to me? Through @@IDENTITY maybe?
Also is there any way to auto-generate random strings of characters for passwords with sql, or should I just do this from the asp script?
Thanks
4waystop
I've got a table which holds account numbers, usernames and passwords. I already know the account number, but I want to add a username and password. Obviously the username must be unique, and the field is set not to accept duplicates. The username is going to be made out of the user's first initial and surname, plus a number if that username already exists. So we are looking at something like:
jbloggs
jbloggs1
jbloggs2
...etc.
Is there any way I can get SQL to try the insert until it gets a result which works and then return it to me? Through @@IDENTITY maybe?
Also is there any way to auto-generate random strings of characters for passwords with sql, or should I just do this from the asp script?
Thanks
4waystop