SQL Problem solved, it wasn't weird, but the responses were
It's always crazy when you post a question to your blog or a forum when you get everything but what you expected as responses. This happened with my SQL "problem" last night.
First the good news. There was no problem. If you look at the sproc I had, I was sorting correctly when I populated the cursor, but not in the join at the end. Whoops! Can't believe no one caught that.
Anyway, one person came in and said you couldn't sort by a bit field. That obviously wasn't true because I was clearly doing it before. When someone called him on it, he said it wasn't ANSI standard and you should avoid it. Should we avoid using the CLR in SQL 2005 too? It's not ANSI standard. Sometimes I just don't understand how people respond.
Another respondant said using a cursor was a bad idea in his experience, but didn't offer an alternative. The article I linked to
makes a pretty strong case for using a cursor to page data. In fact, I searched far and wide on the Web and Usenet to find some kind of quantitative reasoning for this approach, and it's the only one I found. Hey, I'm easily influenced, especially in areas for which I have no significant expertise (like SQL). Show me something better and I'll switch to that. In running this sproc against 30,000 forum topics, it's pretty fast. If I apply a little caching to it, I suspect it will be even faster.
Regardless of the outcome, I love to see people get out there and debate stuff like this. A disadvantage of working alone as your own business is that you otherwise don't have another set of eyeballs to question your work.