i have two tables Table1 and Table2. Where table1 column primary key is referred to table2 column as foreign key.
Now i have to display a error message of constraint violation when ever i delete records from table2 which is having foreign key column of table1.
If I get it right your column A (say) in table 1 references column B (say) in table 2.
What you can do is set the
ON DELETEtoNO ACTIONwhich will prevent deletion of records from table 2 if any children of it still exists in table 1.You can can do this by: