<p>This is probably a simple answer but I can't find it.  I have a table with a column of integers and I want to ensure that when a row is inserted that the value in this column is greater than zero.  I could do this on the code side but thought it would be best to enforce it on the table.</p>

<p>Thanks!</p>

<p>I was in error with my last comment all is good now.</p>

Create a database constraint:
```
```
ALTER TABLE Table1 ADD CONSTRAINT Constraint1 CHECK (YourCol > 0)
```
```
You can have pretty sophisticated constraints, too, involving multiple columns. For example:
```
```
ALTER TABLE Table1 ADD CONSTRAINT Constraint2 CHECK (StartDate<EndDate OR EndDate IS NULL)
```
```