Unsupported Screen Size: The viewport size is too small for the theme to render properly.

[Improve] Copy Database To.. With Query

forums forums SQLyog SQLyog: Bugs / Feature Requests [Improve] Copy Database To.. With Query

  • This topic is empty.
Viewing 3 reply threads
  • Author
    Posts
    • #12875
      sunco
      Member

      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

    • #34028
      peterlaursen
      Participant

      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.

    • #34029
      sunco
      Member

      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”

    • #34030
      peterlaursen
      Participant

      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.

Viewing 3 reply threads
  • You must be logged in to reply to this topic.