Thursday 5 February 2009

SQL Refector

I’ve been using SQL-refactor the last few days to reformat my sql. Not because I am lazy when I write it, but when you write SQL in Reporting Services or Analysis Services (DSV) it removes all the fancy formatting you may have done. On the occasions when you return to edit the SQL, if like me, you can spend some time reformatting it to make your changes.

So I thought there must be a tool out there that can quickly reformat my SQL and that’s when i stumbled on SQL Refactor by Redgate. It does some other clever things, although that wasn’t my main reason for using it, such as qualifying objects and remove redundant code in stored procedures. It does come with a bit of a price tag, but there are some bundles Redgate do that may make justification of its purchase expectable.

You can find some of Redgate’s products already incorporated in the Microsoft stack: SQL 2008 has SQL prompt (2008 maybe not as clever); SQL Compare and SQL Data Compare can be found in team foundation server 2008 Database edition GDR. Note SQL Refactor is not the same as GDR’s refactor.

All in all, SQL Refactor is a clever little utility.