Here's a short script to generate a random alphanumeric string based on newid(). The procedure takes in length (@len) which determines the key length. Length must be between 8 and 32. Result is returned in an output parameter. A test script is supplied.