当前位置:Gxlcms > 数据库问题 > OLE DB Command transformation 用法

OLE DB Command transformation 用法

时间:2021-07-01 10:21:17 帮助过:31人阅读

If External Columns lists no columns you must add them manually.

  • Click Add Column one time for each parameter in the SQL statement.

  • Update the column names to Param_0Param_1, and so on.

  • Specify a value in the DBParamInfoFlags property. The value must match a value in the OLE DB DBPARAMFLAGSENUM enumeration. For more information, see the OLE DB reference documentation.

  • Specify the data type of the column and, depending on the data type, specify the code page, length, precision, and scale of the column.

  • To delete an unused parameter, select the parameter in External Columns, and then click Remove Column.

  • Click Column Mappings and map columns in the Available Input Columns list to parameters in the Available Destination Columns list.

 技术分享

 在input columns中的属性

ExternalMetadataColumnID:指定input column的值要流向的external column的ID

 

 

MSDN对OLE DB Command transformation component的介绍如下: 

The OLE DB Command transformation runs an SQL statement for each row in a data flow. For example, you can run an SQL statement that inserts, updates, or deletes rows in a database table.

You can configure the OLE DB Command Transformation in the following ways:

  • Provide the SQL statement that the transformation runs for each row.

  • Specify the number of seconds before the SQL statement times out.

  • Specify the default code page.

Typically, the SQL statement includes parameters. The parameter values are stored in external columns in the transformation input, and mapping an input column to an external column maps an input column to a parameter. For example, to locate rows in the DimProduct table by the value in their ProductKey column and then delete them, you can map the external column named Param_0 to the input column named ProductKey, and then run the SQL statement DELETE FROM DimProduct WHERE ProductKey = ?.. The OLE DB Command transformation provides the parameter names and you cannot modify them. The parameter names are Param_0Param_1, and so on.

If you configure the OLE DB Command transformation by using the Advanced Editor dialog box, the parameters in the SQL statement may be mapped automatically to external columns in the transformation input, and the characteristics of each parameter defined, by clicking the Refresh button. However, if the OLE DB provider that the OLE DB Command transformation uses does not support deriving parameter information from the parameter, you must configure the external columns manually. This means that you must add a column for each parameter to the external input to the transformation, update the column names to use names like Param_0, specify the value of the DBParamInfoFlags property, and map the input columns that contain parameter values to the external columns.

The value of DBParamInfoFlags represents the characteristics of the parameter. For example, the value 1 specifies that the parameter is an input parameter, and the value 65 specifies that the parameter is an input parameter and may contain a null value. The values must match the values in the OLE DB DBPARAMFLAGSENUM enumeration. For more information, see the OLE DB reference documentation.

The OLE DB Command transformation includes the SQLCommand custom property. This property can be updated by a property expression when the package is loaded. For more information, see Integration Services (SSIS) Expressions, Use Property Expressions in Packages, and Transformation Custom Properties.

This transformation has one input, one regular output, and one error output.

OLE DB Command transformation 用法

标签:规则   功能   set   running   span   ica   tgt   metadata   each   

人气教程排行