SSIS Package not wanting to fetch metadata of temporary table

后端 未结 6 2100
小鲜肉
小鲜肉 2020-11-29 03:39

I have an SSIS Package, which contains multiple flows.

Each flow is responsible for creating a \"staging\" table, which gets filled up after creation. These tables a

6条回答
  •  时光取名叫无心
    2020-11-29 04:03

    Another option (kind of a hack, but it works and doesn't require you to change your use of global temp tables) is to use a SET FMTONLY ON command in front of your actual query to send a fake "First result set" to SSIS with your correct column structure. So you can do something like

    SET FMTONLY ON
    select 0 as a, 1 as b, 'test' as C, GETDATE() as D
    SET FMTONLY OFF
    
    select a, b, c, d from ##TempTable
    

    When SSIS runs sp_describe_first_result_set, it will return the metadata and column names of your FMTONLY command, and won't complain about not being able to determine the metadata of your temp table because it won't even try.

提交回复
热议问题