Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Insert into create new table

I have two large tables and want to combine all of the column names (not as a view) into a new table.

I do not have permission to right click on each table and choose CREATE TO SCRIPT, so I was wondering if there is a way to INSERT both Tables into a new table without specifying the column data types?

like image 779
tdjfdjdj Avatar asked Nov 29 '11 16:11

tdjfdjdj


People also ask

Does insert into SELECT Create new table?

INSERT INTO MyTable SELECT statement to do this. INSERT INTO will not create a new table.

How do you create a table insert?

For a basic table, click Insert > Table and move the cursor over the grid until you highlight the number of columns and rows you want. For a larger table, or to customize a table, select Insert > Table > Insert Table. Tips: If you already have text separated by tabs, you can quickly convert it to a table.

How do I insert data from one table into another table?

SELECT INTO Syntax Copy only some columns into a new table: SELECT column1, column2, column3, ... WHERE condition; The new table will be created with the column-names and types as defined in the old table.


1 Answers

SELECT top 0 *
INTO NewTable
FROM BigTable1
    CROSS JOIN BigTable2
like image 197
Peter Majeed Avatar answered Oct 10 '22 10:10

Peter Majeed