Does SQL Server Compact not support keywords 'Foreign Key References' in Create Table or am I making a mistake?
Posted
by
johnmortal
on Stack Overflow
See other posts from Stack Overflow
or by johnmortal
Published on 2011-02-08T22:49:54Z
Indexed on
2011/02/08
23:25 UTC
Read the original article
Hit count: 219
sql-server-ce
I keep getting errors using Sql Compact. I have seen that it is possible to create table constraints in compact edition as shown here. And according to the documents found here it provides "Full referential integrity with cascading deletes and updates". So am I really not allowed to do the following or am I making a mistake? I keep getting complaints from sql server compact edition that the constaint is not valid, though it works fine on express edition.
CREATE TABLE [A] (AKey int NOT NULL PRIMARY KEY);
CREATE TABLE [B] (AKey int NOT NULL FOREIGN KEY REFERENCES A(AKey));
© Stack Overflow or respective owner