What is the effect of 'delete' on primary key and foreign key

Questions by saritha_racharla

Showing Answers 1 - 4 of 4 Answers

For primary key if that record is being refered by some other (Child Table)  sql server won't let you to delete that record.

While creating relationship if you had mention "Delete Cascade" option and then if you delete the record the same record will be deleted from child table.

  Was this answer useful?  Yes

when you have to delete the records on primary key and foreigh key then there is problem will hapen as primary key violation

at that time you have to provide delete rules when you create the tables
those are

1. on delete no action
2. on delete cascade
3. on delete set null
4. on delete set default

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions