hello friend use this syntax instead of yours it will work fine with your on-delete cascade criteria
create table table1
(
key1 varchar(20) primary key
)
create table table2
(
key2 integer identity primary key,
key1 varchar(20) references table1 on delete cascade
)
create table table3
(
key1 varchar(20) references table1,
key2 integer references table2 on delete cascade
)