Sort by SQL

I am looking for a tool that I can use to clean up (formatting, tabs, etc.) my stored procedures and views. Is there something like html tidy, but for SQL, which is free / open source?

+4
source share
7 answers

Three years later, I just wanted to end this question with two options that seem to be missing, and I think they are more suitable than most of the options listed so far:

  • Bad man T-SQL Formatter / poorsql.com (free, open source, SSMS add-in, command line formatting, full formatting DDL / DML script, and I am the author / maintainer, so I put it in first :))
  • T-SQL Tidy (free, SSMS add-in, full DDL / DML formatting script, apparently 2008R2 add-in can do offline formatting now too - but not open source?)

I believe that any of them makes more sense than any of the previous answers, because the other options available are:

  • Online-only (instant sql formatter)
  • Trial / commercial software (pretty sql printer)
  • Do not format (SSMS toolkit, accepted answer)
  • Do not handle full T-SQL properly (CPAN module, SQL-talk prefix)
  • Incomplete, process only some instructions (SqlFormat project)
+6
source

ssmstools is useful

+4
source

I sometimes use the Instant SQL Formatter , it does the job for me.

+1
source

You can try the free Simple Prettifier Talk:

http://www.simple-talk.com/prettifier/

This is basic, but can satisfy your requirements.

0
source

a ssms 2005/2008 addin: http://code.google.com/p/sqlformat/

it lacks some features, but it's a very good start

0
source

This may or may not help. I have not tried.

https://metacpan.org/pod/SQL::Beautify

0
source

All Articles