28

I mean, something equivalent to Ctrl + K + D from Visual Studio that automatically indents code. Is there something in this sense?

1
  • Thes SQL Formatter at www.sqlinform.com has a window hotkey function which could do the same Commented Aug 24, 2014 at 18:20

5 Answers 5

21

Just discovered this - yet another variation on this older question which has much more activity: SQL Formatter for SQL Management Studio

I personally am a big fan of the Poor Man's T-SQL Formatter / http://poorsql.com - but then I wrote it :)

Sign up to request clarification or add additional context in comments.

2 Comments

Please accept my upvote, kind sir.
Thank you for making the poor man's tsql formatter. You've saved a lot of hours here.
16

By default no but you can always try a third party tools like SQL Prompt mentioned above or ApexSQL Refactor (slightly less options compared to SQL Prompt but it’s a free product) or just use online formatter.

Comments

10

SQL Prompt from Red Gate can do this.

If you just want simple formatting online then the same technology powers FormatSQL.com

2 Comments

Looks like a great product! It's just too bad it's so pricey! (Around $300 at the time of this post)
Format SQL is great! Thanks! I wonder why there is no inbuilt function for thid.
3

SQL Pretty Printer can also reformat SQL. Available as a stand alone app or a SSMS plugin. Free to download (with a nag screen but no other apparent limitations) from http://www.dpriver.com

There is an online version at http://www.dpriver.com/pp/sqlformat.htm?ref=g_wangz

1 Comment

Standalone download version can't save or be copied to the clipboard.
1

There is also the SQLinForm formatter. It is an automatic SQL code formatter for all major databases including ORACLE, SQL Server, DB2, UDB, Sybase, Informix, PostgreSQL, Teradata, MySQL, MS Access etc. with over 100 formatting options.It has a windows hotkey add-on, so you can use it in SSMS. Link: www.sqlinform.com

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.