Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

generate sql using HeidiSQL

I would like to ask is there any config that allow HeidiSQL to generate INSERT query that look like:

INSERT INTO state SET ST_ID = NULL, ST_NAME = "lol"

instead of:

INSERT INTO state (ST_ID, ST_NAME) VALUES (NULL, 'lol')
like image 424
Syafiq Azwan Avatar asked Dec 10 '22 21:12

Syafiq Azwan


1 Answers

Solution:

1. Select a table in heidi
2. In the query tab, select desired column from the right panel.
3. Right click on the selected column and select 'Generate Update..'
4. In the generated query, change the 'UPDATE' command to 'INSERT INTO'.
5. Delete the 'WHERE' command
like image 152
Syafiq Azwan Avatar answered Dec 31 '22 22:12

Syafiq Azwan