July 15, 2004 at 8:09 am
Does anyone have a function or stored procedure to create a unique user name from first and last name? I would appreciate the help.
Thanks
July 15, 2004 at 11:42 am
Would this work?
USE Northwind
select LastName + FirstName +
CONVERT(varchar(2),(DATEPART(mm,GETDATE()))) +
CONVERT(varchar(2),(DATEPART(dd,GETDATE()))) +
CONVERT(varchar(4),(DATEPART(yy,GETDATE()))) +
CONVERT(varchar(2),(DATEPART(hh,GETDATE()))) +
CONVERT(varchar(2),(DATEPART(mi,GETDATE()))) +
CONVERT(varchar(2),(DATEPART(ss,GETDATE()))) +
CONVERT(varchar(4),(DATEPART(ms,GETDATE())))
AS UID
from Employees
Everett Wilson
ewilson10@yahoo.com
July 15, 2004 at 3:14 pm
Elaborating...
USE Northwind
select LastName + FirstName + convert(varchar(36),newid()) from Employees -- Very Unique
select binary_checksum(LastName,FirstName) from Employees-- Case sensitive
select checksum(LastName,FirstName) from Employees-- Case insensitive
/rockmoose
You must unlearn what You have learnt
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply