Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.

"Empty table"-command with foreign key

[expired user]'s profile image [expired user] posted 8 years ago in General Permalink
Hi,
I have two MySQL tables. Table A points to table B via foreign key. If I use "empty table" in HeidiSQL on table B, a TRUNCATE TABLE statement is executed. This statement then fails if FOREIGN_KEY_CHECK ist enabled.

My suggestion: check if a foreign key points to the table (info available in information_schema) and use the slower DELETE TABLE statement instead.
Otherwise a second menu-option (perhaps in a submenu like the one at "create new") to choose between TRUNCATE and DELETE would be nice.

Greetings
Plasm
justpusher's profile image justpusher posted 7 years ago Permalink
+1 to this suggestion.
matsg's profile image matsg posted 5 years ago Permalink

Another +1 from me... I use foreign keys a lot.

Please login to leave a reply, or register at first.




Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.