This blog will give a T-SQL script o create and use Six Digit One Time Password using the SQL Server RAND function.
The RAND function in SQL Server returns a random decimal value. We can run the following script for generating the SIX digits random value that can act as an OTP.
SELECT RIGHT(CAST(RAND()*1000000000+999999 AS INT),6) as OTP
Multiple executions of script generates random 6 digit value as shown below.
Programming and learning are two very important aspects of modern life that can be interconnected and mutually influencing. Programming is important in various fields such as website development, mobile application development, scientific research nurse writers artificial intelligence, data analysis and many more.