How can I generate a cryptographically secure number in SQL Server?

cryptography, sql, sql-server

Solution

Interesting question :)

I think this will work: `CRYPT_GEN_RANDOM`

Problem

I am currently using guid `NEWID()` but I know it is not cryptographically secure. Is there any better way of generating a cryptographically secure number in SQL Server?

Original source