Thursday, August 10, 2017

Using Multiple Custom SQL Formatting Styles in SQL Prompt

DZone Database Zone
Using Multiple Custom SQL Formatting Styles in SQL Prompt

Usually, when coding SQL, you will want to go along with the coding style of the team you are working with. In my previous articles on SQL Prompt, I explained why a team of programmers might want to adopt a T-SQL coding standard, how SQL Prompt could make this easier, and then how to use SQL Prompt to define and share a custom SQL Prompt style (the Louis Davidson style), allowing everyone to enforce this excellent standard in their own code, with minimal effort.

There is just one problem with this, of course, and that’s that there are various reasons why each developer may want to stray, temporarily, from the prescribed standard. Perhaps they need a slightly amended style that makes it easier to compare two different versions of some complex code. Perhaps they need a different style for publishing code to their blog or into a Word document or email. Perhaps the agreed "corporate" or "team" style simply makes their eyes water. Similarly, if you are a consultant who works at multiple locations regularly, you may have a style for each customer, and one to format the code as you like it while you are changing it.

No comments:

Fun With SQL: Functions in Postgres

DZone Database Zone Fun With SQL: Functions in Postgres In our previous  Fun with SQL  post on the  Citus Data  blog, we covered w...