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.

Export grid rows as SQL inserts - group queries

fcunited's profile image fcunited posted 4 weeks ago in General Permalink

I am sure this topic was already raised here.

It is pretty straightforward feature to add ability to group inserts when using "Export grid rows".

Now what you get is:

INSERT INTO table_name VALUES ('a', 'b', 123);
INSERT INTO table_name VALUES ('a', 'b', 123);
INSERT INTO table_name VALUES ('a', 'b', 123);
INSERT INTO table_name VALUES ('a', 'b', 123);
INSERT INTO table_name VALUES ('a', 'b', 123);

And resulted file is far too big.

Why there is no feature to group it and get much smaller file like this?

INSERT INTO table_name VALUES ('a', 'b', 123), ('a', 'b', 123), ('a', 'b', 123), ('a', 'b', 123), ('a', 'b', 123);

1 attachment(s):
  • 1
ansgar's profile image ansgar posted 4 weeks ago Permalink

I highly recommend to use Tools > Export database as SQL for larger exports. That dialog creates such bulk INSERTs, and also takes care about many more issues. The grid export is designed to export CSV files. The other fomats are only icing on the cake.

fcunited's profile image fcunited posted 4 weeks ago Permalink

I highly recommend to use Tools > Export database as SQL for larger exports. That dialog creates such bulk INSERTs, and also takes care about many more issues. The grid export is designed to export CSV files. The other fomats are only icing on the cake.

I expected such response. But very often I need to export only part of table data. For example, in the case mentioned above I backed up only records for October 2021 (applying filter). In such cases Export database as SQL is not suitable, I don't need whole table, which can be millions of rows.

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.