Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Management Studio query formatting Expand / Collapse
Author
Message
Posted Wednesday, March 5, 2008 7:46 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, January 29, 2013 12:04 PM
Points: 2, Visits: 23
Does anyone know if Management Studio can be set up to auto format when writing queries - along the lines of how Visual Studio will automatically indent the next line when writing

IF...THEN
[indent] do this
END.

I have seen add-ins to do this so I'm kind of guessing it can't do this - or there wouldn't be add-ins to do it. But I figure it is worth a shot to ask! Thanks!
Post #464442
Posted Wednesday, March 5, 2008 8:29 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 9:47 AM
Points: 13,872, Visits: 28,270
Nope. Can't do it.

There are a lot of third party tools for this, free, cheap & expensive. Personally, I use Red Gate SQL Prompt & SQL Refactor. Between the two, I can keep my code well formatted.


----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of: SQL Server Query Performance Tuning
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #464477
Posted Wednesday, March 5, 2008 8:32 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, October 10, 2014 8:43 AM
Points: 1,157, Visits: 3,265
Refactor is great for formatting. IntelliSense is included in 2008's SSMS.

An example of an online tool -

http://www.wangz.net/cgi-bin/pp/gsqlparser/sqlpp/sqlformat.tpl


Tommy

Post #464483
Posted Wednesday, March 5, 2008 9:24 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, January 29, 2013 12:04 PM
Points: 2, Visits: 23
Thanks for the information!
Post #464538
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse