DEV Community

Discussion on: How to write SQL queries which are easier to read?

Collapse
 
sagie_chetty profile image
sagie

Hi

I found this article rather obvious, unless someone just started with sql development.

I would recommend using ssmsboost. Google it. It's a free ssms add in if you use the community version. There are so many useful features there that you will soon not be able to work without it. Do yourself a favour, try it out and understand its features. Oh BTW, it has an sql formatter. Not thrilled with it, but you get quick consistency, perfect to help with diffs.

Collapse
 
javinpaul profile image
javinpaul

Thanks @sagie, it may sound obvious but not really as everybody has there own style and many developer doesn't give formatting a thought when writing SQL query, mostly because you don't need it when your query is small. But, when you have more than 4 tables joining, and feting 50+ columns with 10+ conditions it make sense to format it. I didn't know about ssmsboost, thanks for the pointer, I'll take a look.