Thank this author by sharing:
By Oliver Gaudreault,
Today we have a guest editorial from Oliver Gaudreault.
Too often I have seen stored procedures, functions and general SQL scripts that are indecipherable. What does this mean? It means that you will be forced to spend time making the code readable if you are required to debug or investigate code. Many times before I have run across someone who edited an IF statement thinking it was in a block but wasn't. The code in the IF statement applied to everything and the result was not what the original business logic intended. Proper structure and form of the code would remedy this problem.
Using the following would help to make the code more readable:
Not only does this methodology apply to SQL but I believe it also applies for any modern programming language. Some may think that by making your code readable that it might render you replaceable. I beg to differ! I want to see people programming who are versatile. Programmers, who can quickly and easily find and repair an issue with little wasted effort. Lack of time should not equal bad practices. Good practises should equal more time.
This is, of course debatable and I would like to know others thoughts on this?
Some things and readings today reminded me of this: a security control inconsistently applied is not...
update statement using an outer apply in the qualifier
Applying TRANSACTION for DDL statements
If we only use version control as a way to back up our code then it is pure overhead but actually th...
Querying Microsoft SQL Server : Control Statements in T-SQL: Control statements are used to control ...