Sql query

developer trilochan
4 Points
2 Posts

Delete two table data having single sql query first table id field is work as forign key i am not using forign key constaints. Is it possible to delete without constaints. 

Views: 9313
Total Answered: 1
Total Marked As Answer: 0
Posted On: 16-Feb-2017 11:46

Share:   fb twitter linkedin
Rahul Maurya
Rahul M...
1442 Points
241 Posts

If you are not using foreign key constraints , you could do two statements on a single command:

DELETE FROM ChildTable; DELETE FROM ParentTable;

But in effect that is two statements.


You could put a trigger on the ChildTable that deletes parent records on deletion of child record.

I think it will help you. If you are trying any query, post query.


Posted On: 16-Feb-2017 22:59
 Log In to Chat