Hi all,
I have a problem with referential integrity in ms sql server. If I delete a primary key record of one table, the foreign key records are also deleted automatically provided I enable 'Csscade Delete Related Fields' option in the Relationshops Property Page in ms sql server. But if I dont enable this option, there comes the error 'Violation of Foreign Key constraints'. What I want is that if i delete a primary key record, the foreign key record will still retain. For example, i have a room table: Room(roomNo(pk),userid(fk), hardwareid(pk fk), telephoneid(pk fk)) and another table Users(userid(pk), name). On deleting a record in users info, the corresponding foreign key record in Room will still exist but foreign key user id will become null in Room table. Can anyone help me out with this problem? As soon as possible response will be very much appreciated.
Many thanks in adavance...
I have a problem with referential integrity in ms sql server. If I delete a primary key record of one table, the foreign key records are also deleted automatically provided I enable 'Csscade Delete Related Fields' option in the Relationshops Property Page in ms sql server. But if I dont enable this option, there comes the error 'Violation of Foreign Key constraints'. What I want is that if i delete a primary key record, the foreign key record will still retain. For example, i have a room table: Room(roomNo(pk),userid(fk), hardwareid(pk fk), telephoneid(pk fk)) and another table Users(userid(pk), name). On deleting a record in users info, the corresponding foreign key record in Room will still exist but foreign key user id will become null in Room table. Can anyone help me out with this problem? As soon as possible response will be very much appreciated.
Many thanks in adavance...