Friday, July 06, 2007

Set foreign key to zero

Sometimes it is required to insert data to a particular table in a database when testing is carrying out. If this table refers foreign keys then it'll be a problem to do so. For this you can set foreign keys to ignore for the purpose of inserting data. To do it following command should be executed in the mysql cmmand prompt.

SET FOREIGN_KEY_CHECKS=0; 

I hope this will help you to insert data to a table without foreign key trouble.

No comments: