Check constraints spanning multiple tables

M

markeboy

I understood this feature wa introduced in Jet 4.0 but I cannot get this to
work.

I want to ensure that a foriegn key being entered matches an entry in
another table with specific attributes

eg.

ALTER TABLE Movements
ADD CONSTRAINT (OldSubsectionID IN (SELECT ID FROM SubSections WHERE
PublicationID IN (SELECT ID FROM Publications WHERE IsNew=True)));

When I try to execute this (using .Net oledbprovider) I get OleDBException:
Syntax Error in CONSTAINT clause.

What is wrong with my syntax?
Ideally, I would like to give this constraint a name will also change this
to use EXISTS clause as well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top