标签:
OleDB Destination component 是将数据流load 到destination,共有5种Data Access Mode,一般的Destination component 内部实现的原理是使用 insert 语句将数据插入到database中。
如果 OleDB Destination component 选中的 Data Access Mode 使用 Fast load 选项,那么组件使用的sql command发生变化,由insert 变成bulk insert。
如果Data Access Mode 不使用Fast Load 选项,Destination component使用 insert 子句将数据插入到database中,如果Data Access Mode 使用 Fast load 选项,Destination component使用 bulk insert 子句将数据插入到database中,显著提高 performance。
如果 destination table 不存在,可以点击 New 按钮,component自动生成create table 的tsql 脚本,生成 destination table。
CREATE TABLE [OLE DB Destination] ( [code] varchar(10), [name] varchar(10) )
MSDN上对 New 的用法介绍如下
Create a new table by using the Create Table dialog box.
When you click New, Integration Services generates a default CREATE TABLE statement based on the connected data source. This default CREATE TABLE statement will not include the FILESTREAM attribute even if the source table includes a column with the FILESTREAM attribute declared. To run an Integration Services component with the FILESTREAM attribute, first implement FILESTREAM storage on the destination database. Then, add the FILESTREAM attribute to the CREATE TABLE statement in the Create Table dialog box.
Msdn对 OleDB Destination 的5 种 Data Access Mode的介绍如下
Data access mode,Specify the method for loading data into the destination.
Option |
Description |
---|---|
Table or view |
Load data into a table or view in the OLE DB destination. |
Table or view - fast load |
Load data into a table or view in the OLE DB destination and use the fast load option. For more information about the fast load data access modes, which are optimized for bulk inserts |
Table name or view name variable |
Specify the table or view name in a variable. |
Table name or view name variable - fast load |
Specify the table or view name in a variable, and use the fast load option to load the data. For more information about the fast load data access modes, which are optimized for bulk inserts |
SQL command |
Load data into the OLE DB destination by using a SQL query. |
Select the name of the table or view from a list of those available in the data source.
Select a table or view from the database by using this list, or create a new table by clicking New.
Specify whether to copy identity values when data is loaded. This property is available only with the fast load option. The default value of this property is false.
Specify whether to copy null values when data is loaded. This property is available only with the fast load option. The default value of this property is false.
Specify whether the table is locked during the load. The default value of this property is true.
Specify whether the destination checks constraints when it loads data. The default value of this property is true.
Specify the number of rows in a batch. The default value of this property is –1, which indicates that no value has been assigned.
Specify the batch size that the OLE DB destination tries to commit during fast load operations. The value of 0 indicates that all data is committed in a single batch after all rows have been processed.
A value of 0 might cause the running package to stop responding if the OLE DB destination and another data flow component are updating the same source table. To prevent the package from stopping, set the Maximum insert commit size option to 2147483647.
If you provide a value for this property, the destination commits rows in batches that are the smaller of (a) the Maximum insert commit size, or (b) the remaining rows in the buffer that is currently being processed.
Any constraint failure at the destination causes the entire batch of rows defined by Maximum insert commit size to fail.
Select the variable that contains the name of the table or view.
Select the variable that contains the name of the table or view.
Specify whether to copy identity values when data is loaded. This property is available only with the fast load option. The default value of this property is false.
Specify whether to copy null values when data is loaded. This property is available only with the fast load option. The default value of this property is false.
Specify whether the table is locked during the load. The default value of this property is false.
Specify whether the task checks constraints. The default value of this property is false.
Specify the number of rows in a batch. The default value of this property is –1, which indicates that no value has been assigned.
Clear the text box in the OLE DB Destination Editor to indicate that you do not want to assign a custom value for this property.
Specify the batch size that the OLE DB destination tries to commit during fast load operations. The default value of 2147483647 indicates that all data is committed in a single batch after all rows have been processed.
A value of 0 might cause the running package to stop responding if the OLE DB destination and another data flow component are updating the same source table. To prevent the package from stopping, set the Maximum insert commit size option to 2147483647.
Enter the text of a SQL query, build the query by clicking Build Query, or locate the file that contains the query text by clicking Browse.
The OLE DB destination does not support parameters. If you need to execute a parameterized INSERT statement, consider the OLE DB Command transformation.
Use the Query Builder dialog box to construct the SQL query visually.
Use the Open dialog box to locate the file that contains the text of the SQL query.
Verify the syntax of the query text.
标签:
原文地址:http://www.cnblogs.com/ljhdo/p/4487530.html