SQL Refactor™
Latest version: 1.3
Refactor and format your SQL code
- Update all dependant objects when you rename tables, views, and procedures
- Expand wildcards and qualifying object names to improve quality and performance
- Summarize complex SQL scripts
- 11 refactorings in total
SQL Refactor allows you to automatically format your SQL code and database objects in the style of your choice. SQL Refactor improves the quality of your code, making it easier to read, understand and share amongst a team. A companion tool to SQL Prompt, SQL Refactor dramatically speeds up database development and administration, without impacting on the behavior of your database and applications.

Animated gif illustrating Lay Out SQL refactoring
SQL Refactor comes with a full set of 11 refactorings
- Lay Out SQL, to format your code (with over 30 options)

Working with legacy SQL code means untangling someone else's coding format and quickly interpreting the purpose of the script. SQL Refactor provides a range of one-click features that instantly make legacy code as easy to work with as your own, including Layout SQL, Summarize Script, Encapsulate as a New Stored Procedure, and many more.
- Smart Rename, for objects:
- Tables
- Views
- Stored procedures
- User-defined functions

- Smart column rename for views and tables
- Smart parameter rename for procedures and functions
- Split Table, can also create referential integrity tables
- Uppercase Keywords
- Summarize Script
- Expand Wildcards in SELECT statements
- Qualify Object Names
- Find Unused Variables and Parameters
- Encapsulate As New Stored Procedure
SQL Refactor is an add-in to Management Studio and works with SQL Server 2000, 2005, and 2008
To find out about the issues involved in developing SQL Refactor and the various problems the tool has been designed to solve, read the article written for Simple Talk – Red Gate's online technical journal – by Lead Developer, Andras Belokosztolszki.




