Finding unused indexes on MS SQL server

Do you ever find yourself not getting rid of old indexes, when they’re no longer needed ?

I guess we all do sometimes, but luckily SQL server keeps track of the usage of indexes, which allows you to find those unused indexes easily.

Read More »

Getting a “pure” date in MS SQL (without the time)

You probably know the situation: You want to get all records grouped by day, but you stored their creation date using getdate(), so now they all contain time as well as the date.

The solution until MS SQL 2008 was not pretty, however with MS SQL 2008 we finally have a “pure” date datatype.

Read More »

Serverside paging with Ms SQL 2005 / 2008

If you’ve done any amount of website development, you know the issues with paging your data.

With MS SQL 2005 and newer there’s an easy way to do it in your SQL queries. And it even performs better to boot!

Here I’ll sum up how to write proper paging queries with superb performance.

Read More »