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

前端 未结 3 1007
渐次进展
渐次进展 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:30

    Yes, you can create it with

    SELECT INTO ...
    

    Let's say

    SELECT * INTO #t
    FROM OPENQUERY( 'server',
    'exec database.dbo.proc_name value1, value2, ... ' )
    

提交回复
热议问题