DECLARE @DesiredLength AS INT = 10; SELECT Lower(substring(replace(newID(), '-', ''), cast(RAND() * (31 - @DesiredLength) AS INT), @DesiredLength)) AS RandomString;
DECLARE @DesiredLength AS INT = 10; SELECT Lower(substring(replace(newID(), '-', ''), cast(RAND() * (31 - @DesiredLength) AS INT), @DesiredLength)) AS RandomString;