Time for action – Adding a constraint to the Product table
In this exercise, we will use the table designer of SSMS to define a check constraint to the column
ReorderLevel of the
- In SSMS, locate the table Products, right-click on it and select Design. The table designer for the Products table opens in a new tab.
- Inside the table designer, right-click in any column and select Check Constraints…. The Check Constraints dialog window opens.
- Click on Add to add a new check constraint.
- Change the (Name) to CK_Product_ReorderLevel.
- In the Expression field, add ReorderLevel>=0, as shown in the following screenshot:
- Click on Close to dismiss the ...