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

Generate Create Table Script

forums forums SQLyog SQLyog Comments Generate Create Table Script

  • This topic is empty.
Viewing 4 reply threads
  • Author
    Posts
    • #12186
      ggenereux
      Member

      I often have the need to create a new table that closely resembles a currently existing one.

      I’d like to generate the create table SQL to the clipboard or the current query editor window, and then from there tweak it as needed to create the new table.

      This feature is available in MS SQL Studio, and I use it a lot when working over there on the dark side.

      Thanks for the consideration.

    • #31655
      Aparna
      Member

      Hi,

      Quote:
      I’d like to generate the create table SQL to the clipboard or the current query editor window, and then from there tweak it as needed to create the new table.

      This feature is available in MS SQL Studio.

      You could try the following options to get the create table statement in SQLyog:

      1. If you are interested in just viewing/copying the create table statement then select that particular table and click on the info tab. This will display the create table statement for you. If you want to copy it then select the option that reads text/detailed and copy the statement into the editor.

      2. If you want to duplicate the table then there is an easier option to do so. All you have to do is right click on the table, select more table operations and then select duplicate table structure/data . Once you select this, the duplicate table window will pop up. You have options to duplicate both the structure of the table and the structure and data as well. Please see the attached screen shots that will help you understand both the steps better.

      Regards,

      Aparna.

    • #31656
      ggenereux
      Member

      OK, the create table SQL on the INFO tab is exactly what I was looking for.

      Thanks

    • #31657
      ismail
      Member

      i want to create a view of a table how could i create my view of atable in sqlyog …. i am new to sqlyog please help me in that regard.

       

      Table of which i want to create view is products_image in attached

    • #31658
      peterlaursen
      Participant

      If you already have a table the simplest way to create a “view of a table in sqlyog” is CREATE VIEW viewname AS SELECT * fRM tablename;”.  But why would you want to do this?

       

      Besdies a VIEW is a server-side and not a cleint-side object.  Maybe I don’t understand what you mean? 

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