Possible Duplicate:
Generating random strings with T-SQL
I need to generate a random string with alpha and numeric characters inside a trigger.
The string must have a length of 15 and uppercase.
Someone have an idea?
Possible Duplicate:
Generating random strings with T-SQL
I need to generate a random string with alpha and numeric characters inside a trigger.
The string must have a length of 15 and uppercase.
Someone have an idea?
This is far from an optimal solution, but it will work as specified:
select char(rand()*26+65)+char(rand()*26+65)+char(rand()*26+65)
+char(rand()*26+65)+char(rand()*26+65)+char(rand()*26+65)
+char(rand()*26+65)+char(rand()*26+65)+char(rand()*26+65)
+char(rand()*26+65)+char(rand()*26+65)+char(rand()*26+65)
+char(rand()*26+65)+char(rand()*26+65)+char(rand()*26+65)
Example output:
WCZOVRCIRELAJUT
generate a GUID and take just the first 15 characters?
Generate a bunch of random numbers and translate to their ASCII values?