T-SQL: How can you create a table with SELECT?

后端 未结 3 1595
逝去的感伤
逝去的感伤 2021-02-05 02:31

In oracle, you can issue:

 create table foo as select * from bar;

What is the equivalent T-SQL statement?

3条回答
  •  轮回少年
    2021-02-05 03:00

    If you want to write to the tempdb

    Select *
    INTO #tmp
    From bar
    

    or to a SQL DB

    Select *
    INTO Temp
    From bar
    

提交回复
热议问题