forums › forums › SQLyog › SQLyog: Bugs / Feature Requests › [Improve] Copy Database To.. With Query
- This topic is empty.
-
AuthorPosts
-
-
December 7, 2012 at 5:38 pm #12875suncoMember
I often use the Copy Database to different Host/Database feature, and I think it can be improved by allowing users to create some kind of query in it
Lets say I want to Copy an Invoices table, but I just want/need from certain date. When I select the table and right click, it can display options, and one of them is create query. This way, instead of copy 100k rows, I just copy 500 rows
I use SQLyog Enterprise 8.18, yes, I know is old, but it does the job I need very well
-
December 8, 2012 at 4:00 pm #34028peterlaursenParticipant
Your headline refers 'copy database' but your description refers table(s). Are you copying a database to another host or copying table(s) involving only one host?
If the latter is the case you can simply execute “CREATE TABLE databasename.new_table AS SELECT .. FROM databasename.old_table .. “. The SELECT can use any construct that MySQL allows in a SELECT statement (even a GROUP BY with an aggregate function) . But be aware that new_table will be created without indexes. But that would also be necessary if you should implement something similar in the GUI – simply because indexes in old_table may not make sense at all with the result set fetched by the SELECT.
-
December 8, 2012 at 4:32 pm #34029suncoMember
The feature is called as is, but I don't copy all DB, just some tables (maybe 20 of 25)
I think your solution doesn't work with connections.. else, how you specify it ?
Also, maybe I don't want to create the tables, just add some new records and there is no option for “just data”
-
December 9, 2012 at 10:06 am #34030peterlaursenParticipant
If you are working across multiple connections (Is that what you are doing?) the CREATE TABLE .. SELECT .. statement will not work. It is the server that executes the statement and one server knows nothing about another server (unless you use the Federated/FederatedX storage engine: http://dev.mysql.com…age-engine.html .. and that would be an option.
-
-
AuthorPosts
- You must be logged in to reply to this topic.