Dec 12, 2005 #1 thorny00 Programmer Joined Feb 20, 2003 Messages 122 Location US I would like to create a random 6 character field that contains but numeric and alpha characters. How can this be done? i.e. 2TRE3GFH Thanks!
I would like to create a random 6 character field that contains but numeric and alpha characters. How can this be done? i.e. 2TRE3GFH Thanks!
Dec 12, 2005 #2 SQLDenis Programmer Joined Oct 1, 2005 Messages 5,575 Location US select left(replace(newid(),'-',''),6) Denis The SQL Menace SQL blog:http://sqlservercode.blogspot.com/ Personal Blog:http://otherthingsnow.blogspot.com/ Upvote 0 Downvote
select left(replace(newid(),'-',''),6) Denis The SQL Menace SQL blog:http://sqlservercode.blogspot.com/ Personal Blog:http://otherthingsnow.blogspot.com/
Dec 12, 2005 Thread starter #3 thorny00 Programmer Joined Feb 20, 2003 Messages 122 Location US Thanks Denis. So simple and it's exactly what I need ! Upvote 0 Downvote