Link to home
Start Free TrialLog in
Avatar of w3brang3r

asked on

string operation

I need to create bulk users say 500.

so while creating, coming to the passwords....

we use substring(lower(master.dbo.fn_varbintohexstr(hashbytes('MD5','yulkpassword'))),3,32)

which assigns password as password and yulk is the username.....

for eg: if username is rock, we put rockpassword in the above script, so password will be password for rock.

Now, I am developing a storedproc to use for 500 creation activity.

Issue is how to replace the first 4 chars with the username in the above query.....

Please provide solution asap....with proper example.....
Avatar of peea


LEFT(username, 4) + "password" does not work??
Should just be able to do this.  

substring(lower(master.dbo.fn_varbintohexstr(hashbytes('MD5',UserNameField + 'password'))),3,32)

Where UserNameField is the users name.
Avatar of w3brang3r


None of them works!

Thing is I would like use a variable in place of the username part, so that sproc can be developed.....

please reply.
Avatar of w3brang3r

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Got the solution.....using 2 variables.....thanks all.
It was more easy and appropriate.