What is the use of CASCADE CONSTRAINTS?

Answers were Sorted based on User's Feedback



What is the use of CASCADE CONSTRAINTS?..

Answer / naresh

If you specify this option, later when you delete a row in
the parent table, the database server also deletes any rows
associated with that row (foreign keys) in a child table.
The principal advantage to the cascading-deletes feature is
that it allows you to reduce the quantity of SQL statements
you need to perform delete actions.

Is This Answer Correct ?    14 Yes 0 No

What is the use of CASCADE CONSTRAINTS?..

Answer / kunal sain

to drop the constraint from child table when dropping the
constraint from parent table.

Is This Answer Correct ?    10 Yes 1 No

What is the use of CASCADE CONSTRAINTS?..

Answer / nitesh

It is mainly used in referential integrity constraints.

When you use primary key/candidate key of one relation(say,
r1) as foreign key in other relation(say, r2), you want
changes made to primary key/candidate key of r1 must reflect
in foreign key of r2. And this can be achieved by CASCADE
constraint.
eg. consider two relations account, branch(with primary key
branch_name)

create table account(.....
foreign key branch_name references branch
on delete cascade
on update cascade
..........)

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

what is Constraint? How many types of constraints in SQL ?

38 Answers   HCL, IBM, NIIT, Wipro,


How can you tell if a database object is invalid?

0 Answers   MCN Solutions,


What are the advantages dts has over bcp?

0 Answers  


Explain about Joins?

0 Answers   Infosys,


What is database replicaion? What are the different types of replication you can set up in SQL Server?

5 Answers   Aptech, HCL, Perpetual, SAIC,






Explain what is use of dbcc commands?

0 Answers  


What are the differences between left join and inner join in sql server?

0 Answers  


What are the recovery models for a database?

0 Answers  


What is the use of floor function in sql server?

0 Answers  


Can we use where clause in union?

0 Answers  


Please explain what is “asynchronous” communication in sql server service broker?

0 Answers  


What is sql server replication? : sql server replication

0 Answers  


Categories