Paginating Results with MS SQL

mainpgimageIn my last post, I showed you just how simple it is to retrieve paginated results using MySQL. Unfortunately, MS SQL doesn’t utilize the LIMIT command and doesn’t implement any easy way to retrieve paginated results. Instead, you actually have to run three nested queries with MS SQL in order to retrieve a specific subset of results. MS SQL supports a clause called “TOP” rather than “LIMIT” and the “TOP” clause only accepts a single parameter (the number of results to retrieve).

To retrieve paginated results with MS SQL, you will need to write the same query three times, reversing the ORDER BY clause in each query. You also have to use a little simple math in your queries.

Unlimited Hosting Accounts – One Big Gotcha

When you are looking for a new hosting account, it can be extremely tempting to look at some of the very inexpensive packages that claim to be “unlimited.” For the most part, they are telling the truth. While some hosts still arbitrarily restrict the amount of bandwidth or server space you utilize, others have moved on to limiting other resources that are not even mentioned when viewing the “details” of their hosting plans. In those cases, as long as you are not taxing the server resources (memory, CPU, etc.) terribly, you can use up as much space and bandwidth as you want.

However, the one big gotcha you have to watch out for is the “inode” limit. Of the four popular hosts I examined (three of which are offering “unlimited” plans), none of them mentioned any limits (other than the bandwidth and space limits mentioned on Penguin Hosting’s page) on their “details” pages. From the “details” pages, all of them appear to be offering something too good to be true. In fact, they are; but you have to examine their terms of service in order to find out what the limits really are.