SQL: The need for constants in T-SQL
If you look at the code in the image above, I have one immediate reaction.
What are those numbers that are sprinkled throughout the code?
I see this all the time in T-SQL code. Yet in any programming language, it’s a really poor idea to do this. It leads to very fragile code that’s so hard to maintain longer-term.
So why do people do it?
So, you might wonder why people do this in T-SQL. Couldn’t they just do this at the start of the code?
2025-08-14