Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Check Constaint

Author  Topic 

aidmondo
Starting Member

23 Posts

Posted - 2012-05-12 : 13:35:03
How to use the CHECK Constraint to specify a column should accept values greater than 0 (ie >0)

aidmondo

vijays3
Constraint Violating Yak Guru

354 Posts

Posted - 2012-05-12 : 14:40:47
[code]create table #Example
(
Col1 int CHECK (COL1>0)
)



INSERT INTO #Example VALUES(-1)


INSERT INTO #Example VALUES(1)[/code]

Vijay is here to learn something from you guys.
Go to Top of Page
   

- Advertisement -