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

Tell me what is difference between view and materialized view?

881


Explain view in sql server?

1005


What is impersonation? What are the different impersonation options available in ssas? : sql server analysis services, ssas

921


as a general practice, it is recommended to have dbo be the owner of all database objects however, in your database you find number of tables owned by a user other than dbo, how could you fix this? : Sql server administration

913


Why truncate is ddl command?

992


What the class forname () does?

970


why does a sql statement work correctly outside of a user-defined function, but incorrectly inside it? : Sql server administration

973


Do you have any idea about the tcl commands?

909


How can you list all the columns in a database?

885


what number files will a information contain in SQL Server? How many forms of information files exist in SQL Server? How many of those files can exist for a single database?

985


How many joins in sql server?

896


What is the difference between lock, block and deadlock? : sql server database administration

989


What command do we use to rename a db, a table and a column?

872


What is right outer join in sql server joins?

1117


How to select an exiting database using mssql_select_db()?

907