Information générale
Forum:
Microsoft SQL Server
Catégorie:
Maintenance bases de données
Titre:
How to create a check constraint
Versions des environnements
SQL Server:
SQL Server 2000
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
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement