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.

Feature proposal: create a procedure/ function copy

LutzT's profile image LutzT posted 2 years ago in Feature discussion Permalink

I would be nice to have the possibility to create a procedure/ function copy similar to the already exisitng "Create new..." -> "Table copy" (right mouse click at any table). Thanks in advance!

ansgar's profile image ansgar posted 2 years ago Permalink

There is a way how to make a quick copy of just everything into a different database: using the SQL export dialog. Just select the procedures, tables, whatever you want to copy, then rightclick them, and click "Export database as SQL". In the "Target" dropdown, select "Database", and there you are. HeidiSQL just don't offers the same database here, as there is no way to give the copied items another name.

LutzT's profile image LutzT posted 2 years ago Permalink

Thanks for your proposal, Ansgar! This is the way I did it in the past. But this is a bit costly if you have to change multiple procedures/ functions/ events: Either you have to copy them to another database, rename them and copy them back nor you have modify the exported SQL code...

A "Create New.." -> "Procedure/ event/ function copy" dialogue might be possible by adding/ applying an internal "search and replace" within the "Export Database as SQL..." code. There are only three replacements needed... (see screenshot attached)

1 attachment(s):
  • HeidiSQL_feature_request

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