I'm looking for a tool that that I can use to clean up (formatting, tabs, etc.) my stored procedures and views. Is there anything like HTML Tidy, but for SQL which is free/open source?
Two options that seem to be missing, and I think are both more appropriate than most options listed so far:
Poor Man's T-SQL Formatter / poorsql.com (free, open-source, SSMS add-in, command line formatter, full DDL/DML script formatting, and I'm the author/maintainer, so I get to put it first :))
T-SQL Tidy (free, SSMS Add-In, full DDL/DML script formatting, apparently an SQL Server 2008 R2 add-in can do offline formatting also now - but not open-source?)
I believe either of these makes more sense than any of the previous answers because the other options provided are: