Manage Your Business Rules in T-SQL Query


Motivation

At some point in the carrier, we have come across the problem of hard-coded values in SELECT or WHERE clauses.  And we all agree that these hardcoded values must be parametrised. This bad habit usually backfires when we need to troubleshoot a query. These hardcoded values are usually a business role baked in the code. The question I frequently ask myself is, how to manage business logic and business rules for better transparency, code reusability, and faster troubleshooting.

Business Logic

Managing your business logic is not an easy task. Storing it outside of the T-SQL queries will help you build