How do I enforce data integrity rules in my database?

前端 未结 11 1313
滥情空心
滥情空心 2021-01-20 04:07

I\'m designing this collection of classes and abstract (MustInherit) classes…

11条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-20 05:11

    Use CHECK constraints on the table. These allow you to use any kind of boolean logic (including on other values in the table) to allow/reject the data.

    From the Books Online site:

    You can create a CHECK constraint with any logical (Boolean) expression that returns TRUE or FALSE based on the logical operators. For the previous example, the logical expression is: salary >= 15000 AND salary <= 100000.

提交回复
热议问题