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
What are triggers? How many triggers you can have on a table? How to invoke a trigger on demand?
how to determine the service pack currently installed on sql server? : Sql server database administration
What are the disadvantages of merge replication?
What stored by the master? : sql server database administration
How you can move data or databases between servers and databases in sql server?
Can a table have 2 primary keys?
What are the different types of locks in the database?
What happens if strings are casted into wrong code pages in ms sql server?
Can primary key be a foreign key?
What is report rendering ?
Explain how would you store your query in an SSRS report or a Database server?
Why we need to use secondry database file? though, we can do same work using primary database file also.
What are extended events in sql server?
Explain difference between cross join and full outer join?
How to generate create function script on an existing function?