Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
jonekim
Starting Member
35 Posts |
Posted - 2011-09-19 : 21:53:15
|
When creating foreign key relationship, a window appears with different options such as:1. general check existing data on creation or re-enabling: yes2. table designer enforce for replication enforce foreign key constraints3. insert and update specifications delete rule no action cascade set null set default update rule no action cascade set null set defaultWhat are this options, what is the meaning of these options? How to use them properly and when to use them? |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-09-20 : 03:03:31
|
1. this option is used to indicate whether it has to do referential integrity check on creation of fk. if yes, it will throw an error if it finds a value in fk field which is not in reffered field. if no, it ignores this check2. this ias asking whether we need to enforce fk during replication to other dbs3. this are actions to take on child table when an action is done on parentlike what to do when parent record is deleted, when parent field value is deleted etcbased on setting it may either delete fk record altogether or do update to reflect changed value or set it to null/default values------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|