Bulk insert by creating Destination table

Consider the below SQL statement. Even though the statement looks like a select statement actually it performs two tasks. It first creates the destination table disTypeOneMore. Then it queries the Source table Discounts and inserts the resultant data into the destination table created by the statement.

 

The column names and data type of the destination table is taken from the select statement of the source table Discounts.

 

Select discounttype , discount

into DisTypeOneMore

From Discounts;

 Select * from DisTypeOneMore;

Ebook Download
View all
Learn
View all