Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to create a check constraint
Message
From
28/11/2005 04:05:07
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Database management
Title:
How to create a check constraint
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01072346
Message ID:
01072346
Views:
65
Hi all,

We have an sql2000 server up and running. Now i want to add a check constraint to one of the tables. The table contains invoice information about our shops. The field that must be checked can have the null value but when the field is filled out the value must be unique.

Knowing that i opened (via enterprise manager) the my table in designmode a added a check constraint with the following syntax :
(0>SELECT COUNT(*) FROM pos_s_invoice WHERE (doc_no IS NOT NULL and pos_is <> 899)GROUP BY doc_no HAVING (COUNT(*) > 1)).

When i try to save the check constraint i get a validation error without any specification. Can somebody tell me what is wrong ?

thnx
Next
Reply
Map
View

Click here to load this message in the networking platform