SQL Refactor is still the Bomb!

analysis
May 14, 20074 mins

Quite a few months ago, Red-gate came out with SQLRefactor, a tool that let's you setup templates to organize your SQL code, rename objects, etc. I contacted them about getting a license so I could take a look at it, and they promptly replied. I installed it, and was up and running quickly. And within just a couple mins I had things more or less the way I wanted them and was on my way. Let me just say, that this

Quite a few months ago, Red-gate came out with SQLRefactor, a tool that let’s you setup templates to organize your SQL code, rename objects, etc. I contacted them about getting a license so I could take a look at it, and they promptly replied. I installed it, and was up and running quickly. And within just a couple mins I had things more or less the way I wanted them and was on my way.

Let me just say, that this is probably the only tool I use on a daily basis that I’m actually grateful to have. There’s nothing like seeing your code the exact same way every time, and formatting it for YOUR eyes. I personally think this tool buries Microsoft’s tool (Visual Studio Team System for DBAs) for a couple reasons. First, it’s a DBA tool, not a developer tool. You have to be running Visual Studio 2005 to use the MS tool, and you only need SSMS for SQLRefactor. See, I’m a DBA, not a developer, so when I go to open code, I open it in SSMS and I work with it like I’m used to working with it. I don’t have to go into another program, make all new connections, get used to the way things are done there, startup a project and pick a project location, etc. I can just do what I do and have the functionality I need every day. This is something MS has forgotten I think… how to makes our lives easier. The VSTE tool is fine, and it actually does a lot more than this one, but it’s a different type of tool for a different audience. And I think people lose sight of that sometimes.

The 2nd thing that makes SQLRefactor better than VSTE is the price. At $5,000 VSTE is pretty hard to get by your boss… especially for something that’s not going to actually provide any extra benefit day to day. And that’s one thing I’ve always liked about Red-Gate… they don’t gouge your wallet. I can easily talk my boss into the $200 for buying this product, and like I already said, it’ll be far more useful to me as a DBA because it works in SSMS.

Frankly, I have VSTE on my box as well, and I almost never use it. I just don’t do that much in VS, so I don’t have that great of an occasion to need it all that often.

In short, SQLRefactor is a simple tool. It has a slim list of functionality, but for what it does do, it’s actually pretty rich. I use the Lay out SQL feature a lot more than I use the Split Table, but I have also found pretty good uses for Expand Wildcards. What that does is just what it sounds like. It takes a ‘select *’ and turns it into a column list. Very useful. I also like the Smart Rename. One time I even found myself using the Summarize Script just to make sure that my overall process was correct.

This isn’t a full-blown review, and Red-Gate’s not paying me, or has even asked me to write about this. I just love the product, and I wanted you guys to know about it in case you haven’t heard much about it. I wouldn’t exactly say it saves me tons of time every time I use it, but it does make my day just a little more pleasant by allowing me to see things the way I want.

Oh yeah, I almost forgot… another one of my favorite features is the Qualify Object Names. Just before I put something into production, I qualify all the objects in my code with it. Very handy.

There are a couple things I do wish it would do though. I really wish it would take a JOIN statement that doesn’t use aliases and create them and then alias the columns. That would be really handy. I also wish it would take an SP with params and turn it into a normal script with declares and sets. That’s good for troubleshooting. I also wish it would convert a @table into a #Table and vice versa. Same thing for ‘select into’ and ‘insert into’. I have a few other requests, but let’s try to talk them into those first.