views:

322

answers:

4

The sort of stuff I'm after right now is quite basic:

  • Auto format
  • Detect ununsed variables
  • Variable naming convention checking

I wouldn't be surprised if there was a tool available that could handle more complex refactorings such as those found in Refactoring Databases, but I appreciate that the added complexities introduced by current db structure and data state may prevent many of them.

I suppose I'm after ReSQLer

+4  A: 

I have used Embarcadero Rapid SQL for code formating.

Raj More
+1 for the recommendation, but after a bit more than just formatting
MPritch
I presume you're talking about http://www.embarcadero.com/products/rapid-sql ? This seems to do more than just formatting, so might give that a whirl later :) I'd +1 again if I could!
MPritch
+1'd on Martin's behalf, because he seems like a nice guy, and I like to help nice guys out when I can.
lance
+2  A: 

Something like SQL Prompt from RedGate?

Codesleuth
+1 for the recommendation
MPritch
RedGate sponsor the tag `sql-server`, quite funny how this pops up as a question :)
Codesleuth
+13  A: 

RedGate offers SQL Refactor and SQL Prompt, along with a slew of other SQL related tools. Check out their pages for more info and for a free trial.

Ahmad Mageed
+1 For SQL Refactor - looking at the demo and that seems perfect!
MPritch
Just curious, do they allow you to define your own style standards, or must you use their pre-defined set?
Philip Kelley
@Philip I believe its customizable up to the extent their options allow. See this screenshot for an example of some options: http://www.red-gate.com/products/SQL_Refactor/images/sql_layout.gif
Ahmad Mageed
+2  A: 

SQL Prompt has basic format and beautify functions now, if you don't want to buy both products

The free SSMS Tools Pack supports basic beautify as well I believe http://www.ssmstoolspack.com/Features?f=3

Uppercase/Lowercase keywords and proper case Database Object Names. Set all keywords to uppercase or lowercase letters. Custom keywords can be added. Format all database objects to their proper case sensitive name.

jerryhung