Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to create a check constraint
Message
From
28/11/2005 15:41:17
Jon Neale
Bond International Software
Wootton Bassett, United Kingdom
 
General information
Forum:
Microsoft SQL Server
Category:
Database management
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01072346
Message ID:
01072599
Views:
20
Thanks I didnt know that.

>Kurt,
>
>SQL 2000 doesn't allow subqueries in a Check Constraints. You can either use UDF() or put the check in a trigger.
>
>
>>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 ?
Previous
Reply
Map
View

Click here to load this message in the networking platform