Problem / Solution
There are several functions that are included with Excel that are not included with SQL Server. One of these functions is the RANDBETWEEN function. This function allows you to return a random number between a lower and upper bound values. In this video tip, Dallas Snider will show how you can create your own T-SQL function to mimic the Excel RANDBETWEEN function.
Key Learning Items
- Examples of the RANDBETWEEN function
- Creating a T-SQL RANDBETWEEN function
- Issues using the T-SQL RAND() function in a UDF and how to get around the it
Read Companion Tip

Dr. Dallas Snider is an Assistant Professor in the Computer Science Department at the University of West Florida. He received his Ph.D. in Integrated Computing and M.S. in Instrumental Sciences from the University of Arkansas at Little Rock. He received a B.A. in Physics from Hendrix College. Before joining UWF, he worked as a data warehouse developer for Northrop Grumman Information Systems and prior to that as a database application developer for Acxiom and Euronet. Dr. Snider’s teaching and research interests include data mining, data warehousing, information visualization, and software development.


