Click here to Skip to main content
15,890,579 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
hello friend
i want delete data from two table and both tables r realted with each other means one filed is comman.
can i use join in the tables??
i have one solution that is deleted command two times first deleted child and then parent.
any other way by which i can delete data form both table like join??
plz guide me friends
Posted

You can have cascaded delete set up, so that when you try to delete the parent record all the related child records are deleted. Take a look at the detialed example here.

Performing a Cascade Delete in SQL Server 7[^]

Alternatively, if you are manually deleting records then you should make sure you are deleting them in a single transaction, either in c# code or in sql.
 
Share this answer
 
Start here[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900