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

前端 未结 3 1498
攒了一身酷
攒了一身酷 2021-02-03 19:02

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

3条回答
  •  情深已故
    2021-02-03 19:22

    Yes, you can create it with

    SELECT INTO ...
    

    Let's say

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

提交回复
热议问题