使用EzAPI在SSIS包中自动创建表

时间:2022-03-26 20:54:32

I wouldn't be suprised if this turned out to be a BIDS function rather than available through EzAPI.

如果这被证明是BIDS功能而不是通过EzAPI可用,我不会感到惊讶。

I've written some code using EzAPI to generate an SSIS package with an OLEDB source and destination. The Destination table however does not exist and I'd like it to be created in the same way the new button would work in BIDS. Is this possible?

我已经使用EzAPI编写了一些代码来生成带有OLEDB源和目标的SSIS包。然而,Destination表不存在,我希望它的创建方式与新按钮在BIDS中的工作方式相同。这可能吗?

2 个解决方案

#1


1  

in general you are right, that this is a functionality of the BIDS. But you can use SQL Task Component for running DDL Script.

一般来说,你是对的,这是BIDS的功能。但您可以使用SQL任务组件来运行DDL脚本。

The Destination component has also ValidateExternalMetadata property. If you set it to false, then SSIS will not validate you the destination against the database. This flag can be used if the destination table does not exist when you are generating your package . In your case you should disable validation.

Destination组件还具有ValidateExternalMetadata属性。如果将其设置为false,则SSIS不会根据数据库验证目标。如果在生成程序包时目标表不存在,则可以使用此标志。在您的情况下,您应该禁用验证。

#2


2  

You can create tables (or run other DDL) from an SSIS Control Flow. Is there some reason that approach won't work for you here?

您可以从SSIS控制流创建表(或运行其他DDL)。有什么理由说这种方法对你不起作用吗?

#1


1  

in general you are right, that this is a functionality of the BIDS. But you can use SQL Task Component for running DDL Script.

一般来说,你是对的,这是BIDS的功能。但您可以使用SQL任务组件来运行DDL脚本。

The Destination component has also ValidateExternalMetadata property. If you set it to false, then SSIS will not validate you the destination against the database. This flag can be used if the destination table does not exist when you are generating your package . In your case you should disable validation.

Destination组件还具有ValidateExternalMetadata属性。如果将其设置为false,则SSIS不会根据数据库验证目标。如果在生成程序包时目标表不存在,则可以使用此标志。在您的情况下,您应该禁用验证。

#2


2  

You can create tables (or run other DDL) from an SSIS Control Flow. Is there some reason that approach won't work for you here?

您可以从SSIS控制流创建表(或运行其他DDL)。有什么理由说这种方法对你不起作用吗?