Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to write query to Delete the records in child table
and corresponding records in parent table

Answer Posted / surya

use this:

DELETE FROM childTable WHERE EXISTS(SELECT id FROM
parentTable WHERE parentTable .id = childTable .id where id = 1)

Is This Answer Correct ?    4 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a SQL query to delete a table?

1124


Can you explain what are the restrictions applicable while creating views? : SQL Server Architecture

900


Which tools are available to manage SQL Azure databases and servers?

115


How do users use Report Builder with SQL Server data sources?

152


What is a collation in ms sql server?

1060


What is a data source or ds? : sql server analysis services, ssas

984


How to insert and update data into a table with "insert" and "update" statements?

960


How to create function without parameter in sql server?

1041


What are different types of raid configurations? : SQL Server Architecture

1055


What is the use of @@spid?

984


What is resource governor?

955


What is difference between inner join and full join?

1044


What are subqueries in sql server?

1099


in the physical file layout, where should the transaction log be stored in relation to the data file?

976


Can truncate be rolled back?

921