Best pattern for Constants in SQL?

后端 未结 4 1191
心在旅途
心在旅途 2020-12-15 10:23

I have seen several patterns used to \'overcome\' the lack of constants in SQL Server, but none of them seem to satisfy both performance and readability / maintainability co

4条回答
  •  情书的邮戳
    2020-12-15 11:11

    You can also add more fields to your status table that act as unique markers or groupers for status values. For example, if you add an isLoaded field to your status table, record 87 could be the only one with the field's value set, and you can test for the value of the isLoaded field instead of the hard-coded 87 or status description.

提交回复
热议问题