Menu

Foreign Key Constraints in SqlCe

May 1, 2009 - SQL
Foreign Key Constraints in SqlCe

How do you add foreign key constraints in SqlCe?  Like this:

ALTER TABLE tablename ADD CONSTRAINT FK__nameofforeignkey FOREIGN KEY (id) REFERENCES tablename(id) ON UPDATE CASCADE

How do you check it’s there?

SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS
Share

Leave a Reply

Your email address will not be published. Required fields are marked *

*