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

I Need To Update My Sql Database.

forums forums SQLyog Using SQLyog I Need To Update My Sql Database.

  • This topic is empty.
Viewing 1 reply thread
  • Author
    Posts
    • #11779
      baagel
      Member

      Hello everyone. I need help updating one of my SQL databases. 😆

      So, I have two different databases. One is newer than the other. However, I have made an SQL dump of the older database and would like to merge the old one's data with the newer one. But, I can't do that because of duplicate entries. Does anyone have a solution for me?

    • #30102
      peterlaursen
      Participant

      Maybe you can use an INSERT .. SELECT construction. If your table has the columns (id, col1, col2, col3)

      Code:
      INSERT INTO table1 (col1, col2, col3) SELECT col1, col2, col3 FROM table2;

      .. note that primary/unique key is not specified in (col1, col2, col3) list. Import the two dumps to two different tables first.

      However if you have Foreign Keys or other types of references between tables I do not believe it is possible in simple SQL. It will require some programming logic to ensure that references between rows of different tables are kept intact. You may use your favorite scripting/programming language or a Stored Procedure.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.