Skip to content
Advertisement

How do I generate random number with a range X times in SQL SERVER

I want to generate a random number X times with a range. I’ve tried to create a function:

The query only returns a single row:

I want the following result:

Is it possible?

Advertisement

Answer

You can use recursive approach :

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement