For generate random alphanumeric string in sql server, use following query:
This will return alphanumeric string with 8 digit.
If you want to use this query to sql server function then refer my another blog from following link:
Use NEWID() in sql server function
SELECT CAST((ABS(CHECKSUM(NEWID()))%10) as varchar(1)) + CHAR(ASCII('a')+(ABS(CHECKSUM(NEWID()))%25)) + CHAR(ASCII('A')+(ABS(CHECKSUM(NEWID()))%25)) + left(NEWID(),5)
This will return alphanumeric string with 8 digit.
If you want to use this query to sql server function then refer my another blog from following link:
Use NEWID() in sql server function