TSQL Define Temp Table (or table variable) Without Defining Schema?

前端 未结 3 1008
渐次进展
渐次进展 2021-02-03 19:10

Is there a way to define a temp table without defining it\'s schema up front?

3条回答
  •  清酒与你
    2021-02-03 19:33

    you don't need OPENQUERY. Just put "INTO #AnyTableName" between the select list and the FROM of any query...

    SELECT *
        INTO #Temp1
        FROM table1
        WHERE x=y
    

提交回复
热议问题