英文:
How to Get Azure Data Factory to delete a field before send a table to Sink Without using DataFlows
问题
可以在将表发送到Sink位置之前,让ADF删除表中的字段吗?例如,如果我有一个Lookup活动,发现表中的一个字段,那么在将表发送到Sink之前,能否让复制活动删除该字段?
英文:
Is it possible to get ADF to delete a field in a table before it is sent to Sink location?
For example if I have a Lookup activity that discovers a field in a table is it possible to for the copy activity to delete that field in the table before sending the table to sink?
答案1
得分: 1
你可以将以下 SQL 脚本添加到复制活动的预复制脚本中的接收器设置中:
IF EXISTS (SELECT 1
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'Table1'
AND COLUMN_NAME = 'col1'
AND TABLE_SCHEMA='Schema1')
BEGIN
ALTER TABLE Table1
DROP COLUMN col1
END
英文:
You can add the below sql script in the pre-copy script in the sink settings of copy activity:
IF EXISTS (SELECT 1
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'Table1'
AND COLUMN_NAME = 'col1'
AND TABLE_SCHEMA='Schema1')
BEGIN
ALTER TABLE Table1
DROP COLUMN col1
END
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论