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 are the differences in Clustering in SQL Server 2005 and 2008 or 2008 R2?

0 Answers  


What is correlated subquery in sql server?

0 Answers  


What is a rownum?

0 Answers  


Explain how long are locks retained within the repeatable_read and serializable isolation levels, during a read operation with row-level locking?

0 Answers  


What are scalar functions?

0 Answers  






What are relationships and mention different types of relationships in the dbms

0 Answers  


What are cursors? Explain different types of cursors. What are the disadvantages of cursors? How can you avoid cursors?

0 Answers  


Explain what is lock escalation?

0 Answers  


How to change the password of a login name in ms sql server?

0 Answers  


Is null in sql server?

0 Answers  


What are indexes? When do you need to create Indexes?

4 Answers   CarrizalSoft Technologies, HP,


How can I create a report based on a query? : sql server management studio

0 Answers  


Categories