|
Hi! I am going to create table in a Microsoft Access database and set a field as Foreign Key for a Primary Key of another table, by sql command. I write as below:
CREATE TABLE ( ... field_name BYTE REFERENCES table_name, ... )
So the field_name would be a Foreign Key for the Primary Key of table_name. Now I want to cascade update and delete related fields. As Microsoft Access Help says I should write:
CREATE TABLE ( ... field_name BYTE, ... CONSTRAINT ForeignKey FOREIGN KEY (field_name) REFERENCES table_name ON UPDATE CASCADE ON DELETE CASCADE)
But it does not work! I may it is just for SQL Server. How should I write the command?
Regards! M.Sadegh Samiei |