Unanswered: Break data-set into groups of 5000 records
I have a large data set that I want to split into groups of 5000 records so if there are 11000 rows in the table, rows 1 thru 5000 will be labeled 1, 5001 thru 10000 labeled 2, and 10001 thru 11000 labeled 3.
I use NTILE() a lot but that clearly doesnt work in this instance. I am thinking of dividing the row number by 5000 and that result+1 (ignoring the remainder) would be it's group number. Perhaps there is a better way? Maybe a different window function in SQL 2012?