Need to export SQL only some columns, and UPDATE statement

locario posted 12 months ago in General

Hi there!

Newbie here, and using HeidiSQL since 1 month. I have some problems exporting a SQL file with a specific columns, it's possible to select only 2 columns exporting a table?.

Also, i want to gerenate a SQL file with UPDATE statement, as a picture, see it and tell me please.

Any question please ask me.

Thanks all.

2 attachment(s):
  • Captura
  • Captura2
ansgar posted 12 months ago

Columns cannot be restricted in "Table tools" > "SQL export".

But you could do that in the grid export dialog on a query tab. Fire your custom SQL query with the column(s) you want to export, then run it. Then, on the result grid, rightclick and click "Export grid rows".

I don't understand your "UPDATEs as a picture" question.

locario posted 12 months ago

Hey, tnx for the help.

I do this query : "select entry,content_loc6 from creature_ai_texts;"

then i export grid rows works as expected.

Second question, when i import that SQL file, it erases all columns except exported ones ¿How i can solve it?

Would be perfect generate the SQL export as this query, that works like a charm for my pruporse:

UPDATE creature_ai_texts SET entry='-1', content_loc6='Parece que esos idiotas de la Abadía nos han enviado carne fresca.' WHERE (entry='-1');

Thanks again

ansgar posted 12 months ago

Second question, when i import that SQL file, it erases all columns except exported ones ¿How i can solve it?

No, it probably erases rows, not columns. That's an important difference. Which SQL format did you select for the export? There are 3 different ones. There is no UPDATE export, but I guess the REPLACE option suits your needs.

locario posted 12 months ago

Al the three options erases rows :-|

ansgar posted 12 months ago

No, INSERTs throw errors without deleting rows. However, there is no UPDATE mode.

locario posted 11 months ago

Would be nice to add that feature, there is not program in all internet that have that feature.

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