简体   繁体   中英

ADF - Access #table or Temp table used in Script task activity output to be used in Copy activity as source

We have simple script consider the one below as an example.

Script:

create table #tableABC (
    col A varchar(10),
    col B varchar(10),
    col C varchar(10)
)

insert into #tableABC
    select 'A' ,'B', 'C'

The above script is considered as an SP and excepted in script task and it works. but we are unable to access the #table in the following copy activity

select * from #tableABC;

在此处输入图像描述

Azure data factory doesn't support automatic temporary table creation and we cannot set table name with ## as starting.

  1. TempDB is the location where we can find the temporary tables. We cannot choose the temporary tables as datasets in ADF

How to create temp tables in SQL to be used in several ADF activities?

Refer the above link, which has lot of suggestions.

https://github.com/MicrosoftDocs/azure-docs/issues/35449

Also refer the above blog for additional support.

Note: Do not close the SQL connection session after creating temporary table.

Alternate suggestion:

Instead of using the Temp Tables, use the table type for easy usage.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM