I have a query with a hard coded value which is also hard coded into my application (which has a comment saying that the value should be the same as the value hard coded into the query).
What would be considered the best way to make that value discoverable outside of the single query it is being used in?
A UDF immediately jumps to mind, but prior to 2019 it kills performance (don’t have 2019 so I can’t verify it, but it seems inlined UDFs should fix the performance problem).
A view or TFV might be a good alternative, but both seem overly complex and a misleading.
I don’t have a table/view of constants/lookup values.
Is there a good solution for this situation or just stick with comments in the relevant code?