Export Query Result via SQL Inserts WITHOUT database prefix



I am attempting to export the results from an SQL from one database into another. The export is generated by all the insert statements have a database prefixed table names, which makes the export useless for me as I want to load the inserts into a different database.

Is there a setting I can disable this behaviour - i.e. do not prefix the table name with a database name?

Thank you for any help.


Hello? Is this possible? The current export is useless for me.


@Nazar Aziz

To change default behavior for export  you need to modify groovy script:

or to use find & replace in your result file.




I have the same problem. Was doing a migration and realise I couldn't omit the DB name, had to use `sed` to search and replace in the end. 

Would be good to make it an option to omit or include the prefix as I believe not everyone names the db locally and remote the same.



Feel free to change groovy script for your needs.


groovy script is much slower, please support this!


Do we still don't have this feature?


Omar Tariq, what RDBMS do you work with?

And, as I mentioned before, feel free to modify groovy script. For detailed description take a look at or GitHub repo https://github.com/DataGrip/dg-scripted-extensions-environment


Please sign in to leave a comment.