While seeding a database with data for a DataFix Rosetta Code post I thought it would be helpful to be able to determine the percentage (or get as close to it as possible) for a set of data.
Typically this would be in a WHILE
loop, for all the examples below the upper bound loop until would have been 1000.
Example use case: for half the data set a date field:
1 | IF (@Counter % 2 = 0) |
Quarters
1 | ---- QUARTERS |
Thirds
1 | ---- THIRDS |
Tens
1 | ---- TENS |
Having a hoon
I used the script below to figure out the values above.
1 | DECLARE @Counter int = 0; |