O'Reilly logo

NHibernate 3 Beginner's Guide by Gabriel N. Schenker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 Products table.

  1. 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.
  2. Inside the table designer, right-click in any column and select Check Constraints…. The Check Constraints dialog window opens.
  3. Click on Add to add a new check constraint.
  4. Change the (Name) to CK_Product_ReorderLevel.
  5. In the Expression field, add ReorderLevel>=0, as shown in the following screenshot:
    Time for action – Adding a constraint to the Product table
  6. Click on Close to dismiss the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required