I need populate with dummy values a table.
I need create a random generated value “RANDOM_VALUE” for every single row created.
Random value must be a string and its range could be only ‘A’ or ‘B’.
The script should be able to list a series of row with value A or B randomly generated
Here an example of how should work:
ROW RANDOM_VALUE
1 A
2 B
3 B
4 A
... ...
Any ideas how to do it? Thanks!
Rand()is only evaluated once per column so will be the same for all rows to get around this you can useNewId()as below.If you need the output exactly as per your question just join onto a big enough table. e.g.