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
Tell me what is difference between view and materialized view?
Explain view in sql server?
What is impersonation? What are the different impersonation options available in ssas? : sql server analysis services, ssas
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
Why truncate is ddl command?
What the class forname () does?
why does a sql statement work correctly outside of a user-defined function, but incorrectly inside it? : Sql server administration
Do you have any idea about the tcl commands?
How can you list all the columns in a database?
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?
How many joins in sql server?
What is the difference between lock, block and deadlock? : sql server database administration
What command do we use to rename a db, a table and a column?
What is right outer join in sql server joins?
How to select an exiting database using mssql_select_db()?