Site sponsored by: Idera The gold standard of SQL Server performance monitoring & diagnostics.
SQL Server Performance

  • Home
  • Articles
  • Forums
  • Tips
  • Quiz
  • FAQ's
  • Blogs
  • Software
  • Books
  • About Us
RSS Feeds
Sign in | Join


Product Reviews

All Reviews
Audit Tools
Backup Tools
Change Management Tools
Clustering Tools
Coding Tools
Design Tools
Diff / Compare Tools
Documentation Tools
Job Management Tools
Log Recovery Tools
Monitoring Tools
Remote Access Tools
Reporting Tools
Security Tools
Testing Tools

Write for Us

Share your SQL Server knowledge with others and raise your profile in the community More...
Latest Articles

Recover Data Using Database Snapshots
Analyze and Fix Index Fragmentation in SQL Server 2008
Powerful Geographical Visualisations made easy with SQL 2008 Spatial (Part 2) ...
Backup User Databases Using a Maintenance Plan

More     
 
Latest FAQ's

How to alter a User Defined Data Type?
How to unzip a File in SSIS?
How to view previous query plans?
ALTER TABLE SWITCH statement failed because the object '%.*ls' is not ...

More     
   
Latest Software Reviews

Spotlight on ApexSQL Doc 2008
ApexSQL Enforce
Embarcadero Change Manager
SQL Server DBA Dashboard

More     

reviews >> coding tools >> Red Gate's SQL Refactor Boosts DBA Productivity ...

Red Gate's SQL Refactor Boosts DBA Productivity

By : Brad McGehee
Jul 26, 2007

Page 2 / 7


Using SQL Refactor

To use SQL Refactor, you launch Management Studio, and in most cases, open a new query window, where you work with your Transact-SQL code.

All SQL Refactor functionality is available from this drop-down menu in Management Studio.

Before you begin to use SQL Refactor the first time, you may want to check the SQL Refactor Option screen to see if the default values meet your needs. You have the option to control how Transact-SQL code is formatted and how identifiers are delimited, as well as the ability to create and use what are called Option Sets. Let's take a brief look at each of these three options and what they can do for you. The screen below is the first screen you see when you choose Options.

After displaying the SQL Refactor Options screen, you are presented with three tabs. The first tab, Lay Out SQL, is where you specify how you prefer Transact-SQL code to be laid out when you tell SQL Refactor to Lay Out non-formatted or poorly formatted code.

As you can see, there are many different options you can choose in regard to how commas, indentions, wrapping, spacing, along with many more formatting options, are implemented. What is really handy about this screen is that once you choose a formatting option that formatting option is displayed immediately on the screen so you can see what you have chosen and how it looks.

For example, one of the options you have is to place commas at the end of a line, or at the beginning of a line. When you choose one of these options, the screen changes, allowing you to immediately see how the formatting works.

In the screen below, I have chosen to place commas at the end of a line.

But now, I have chosen to place commas at the beginning of a line.

As you can see from this example, it is very easy to select the code formatting options you prefer.

The next option you have is the Scripts tab, which you see below.

When SQL Refactor creates or modifies scripts, it has the ability to always delimit identifiers, or to only delimit identifiers that contain special characters or reserved words. You can choose which format you prefer.

The last tab is called Option Sets. This allows you to save a set of SQL Refactor defaults that you can recall and use over and over. Some DBAs might be satisfied with one set of default options for all their work, while other DBAs might want to have multiple default sets that represent different formatting options, depending on what they are doing.

As you can see from the above screen, you can create multiple options sets, giving each set its own unique name.

Once you have set the defaults for SQL Refactor, you are now ready to use the tool. In this next section, we take a look at all of SQL Refactor's key features, and see how well they really work.


<< Prev Page     Next Page>>    








Home | Peformance Articles | Audit Articles | Business Intelligence Articles | Clustering Articles | Developer Articles | Reporting Services Articles | DBA Articles | ASP.NET / ADO.NET Articles | DBA FAQ's | Developer Peformance FAQ's | DBA Peformance FAQ's | Developer FAQ's | Clustering FAQ's | Error Messages | Audit Tool Reviews | Backup Tool Reviews | Coding Tool Reviews | Compare Tool Reviews | Documentation Tool Reviews | Design Tool Reviews | Monitoring Tool Reviews | Log Tool Reviews | Reporting Tool Reviews | Clustering Tool Reviews | Security Tool Reviews | Change Management Tool Reviews | Remote Access Tool Reviews | Book Reviews | Security Tool Reviews | QDPMA Performance Tuning | ADO.NET / ASP.NET | Administration | Analysis/OLAP Services | Application Development | Configuration | Components | ETL | Hardware | High Availability | Hints | Index | Misc | Operating Systems | Performance Tuning | Replication | T-SQL | Views


              © 1999-2008 by T10 Media. All rights reserved