Ignore foreign key while inserting new data

Posted: October 17, 2013 in MySql
Tags:

You can add this line in top of your script which will allow you to insert any foreign values.

SET FOREIGN_KEY_CHECKS = 0;

And then at end again add

SET FOREIGN_KEY_CHECKS = 1;

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s