Friday, March 30, 2012

MS ACCESS - ON DELETE CASCADE Problem

I cannot execute my sql to create a table with ON DELETE CASCADE option.
Here is my sql:

CREATE TABLE Employees (Name Text(10) not null, Age number,
CONSTRAINT pkEmployees
PRIMARY KEY (Name)); <-- This is ok!

CREATE TABLE CanTake (Name Text(10) not null, Make Text(10) not null,
CONSTRAINT pkCanTake
PRIMARY KEY (Name, Make),
CONSTRAINT fkCanTake
FOREIGN KEY (Name) REFERENCES Employees
ON UPDATE CASCADE <-- MS-ACCESS says 'syntax error'
ON DELETE CASCADE
);

When I didn't include ON UPDATE CASCADE ON DELETE CASCADE in sql, it works
(but that's not what I want). Why? Could anyone suggest me?
Thank you.

--
Message posted via http://www.sqlmonster.comMSDN suggests that you need to use ALTER TABLE to add cascading DRI:

http://msdn.microsoft.com/library/d...ml/acintsql.asp

However, I know very little about Access, so I suggest you post in an
Access group to get a better response.

Simon|||Thank you.

--
Message posted via http://www.sqlmonster.com

No comments:

Post a Comment