I’ve been trying to solve this problem for a few days now without much luck. I have found loads of resources that talk about paging on SQL Server 2000 both here and on codeproject.
The problem I am facing is trying to implement some sort of paging mechanism on a table which has three keys which make up the primary key. Operator, CustomerIdentifier, DateDisconnected.
Any help/pointers would be greately appreciated
SQL Server 2000 doesn’t have the handy
row_numberfunction, so you’ll have to auto-generate a row number column with a subquery, like so:However, you can sort those rows by any column in the table — it doesn’t have to use the composite key. It would probably run faster, too!
Additionally, composite keys are usually a flag. Is there any particular reason you aren’t just using a surrogate key with a unique constraint on these three columns?