Category Archives: SQL

The importance of well formatted SQL

Everyone knows the importance of well formatted code in whatever language and I don’t think I’ll have to convince anyone on that point.  But today I have a situation where there are SQL statements saved in a field inside a database table.  These statements are not just simple SELECT statements but are more like what would constitute a small stored procedure.  Much to my disappointment, these statements are stored as single lines of text making any modifications to it become an endless repetition of  TAB, TAB, ENTER, TAB, TAB, ‘TAB, ENTER, TAB, TAB, ‘TAB, ENTER, TAB, TAB, ‘TAB, ENTER, TAB, TAB, ‘TAB, ENTER.  You get the picture…

I know that there are some SQL Management studio add-ins that can take an SQL statement and format it automatically but my situation at this particular client is that I cannot install anything on the development PC and so I have to rely on web-based stuff a lot.

After a quick look around the Web, I stumbled on this web-based SQL formating tool that does the job very well so I thought I’d share!

Do you know of any other tools that can do the job? Preferably non-web based and no installation required. Please share with me in the comments below.

%d bloggers like this: