Select into statement

9/12/2020 8:01:10 AM

Select into statement is responsible to create table if table is not present and then we stored the data from another table which field we create we can create specific column for the created table.

Filed name must be same as old table. Now given bellow the code and explain the code:

select [Name],[Email] into [crud].[dbo].[TestSelectInto] from [dbo].[Teacher]
/*select Table*/
select * from [dbo].[TestSelectInto]

first, we create new table name as TestSelectInto then we stored date from Teacher then we show the TestSelectInto table.