• gitHub
  • linkedin
  • twitter
Foreign Key Constraints in SqlCe

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

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.