OleDB Destination 用法
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了OleDB Destination 用法,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含7741字,纯文字阅读大概需要12分钟。
内容图文
![OleDB Destination 用法](/upload/InfoBanner/zyjiaocheng/479/b26f6300084a4a9685130e9d86761016.jpg)
1,如果 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 theCreate Table dialog box.
2,Fast Load 选项
当使用Fast Load 选项时,Destination 组件使用bulk insert来批量插入数据。
Keep identity : 当目标表中存在Identity column时,如果不选中 Keep identity,那么 目标表中的Identity Column的值是自动生成的;如果选中Keep identity,那么目标表中的ID值和数据源保持相同。
Keep Nulls:如果目标表为某一列设置了default约束,当数据流传递null给该列时,正常情况下会触发目标表的default约束。如果不选中Keep Nulls,那么目标表使用default value来填充数据列;如果选中Keep Nulls,那么目标表保持该列为null。
Table Lock:如果选中,那么在插入数据之前,为整个destination table 加上表级锁。
Check Constraints:检查插入数据到destination table的数据是否符合destination table 的 constraint,如果能够确定数据符合target table的constraint,那么不选中 Check Constraints 会显著提高performance。
当插入大量数据的时候,适当控制 tempdb 和 transaction log的大小,能提高数据插入的的performance。
Rows per batch:配置 bulk insert 每一个batch 插入的数据行。
Maximum insert commit size:当插入指定数量的数据行时,commit 一个 transaction。
Any constraint failure at the destination causes the entire batch of rows defined by FastLoadMaxInsertCommitSize to fail.
3,Sql Command Mode
当从 Data Access Mode list 中选择 Sql Command 时,组件需要 sql select query 子句,而不是 insert 语句。
组件从Select 子句中获取 target table 的数据列的MetaData,设置 column mapping, 组件按照 column mapping 将数据插入到目标中。
4,sql command mode 不支持 parameter
The OLE DB destination does not support parameters. If you need to execute a parameterized INSERT statement, consider the OLE DB Command transformation.
第二部分: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.
Name of the table or the view
-
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.
- Keep identity
-
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.
- Keep nulls
-
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.
- Table lock
-
Specify whether the table is locked during the load. The default value of this property is true.
- Check constraints
-
Specify whether the destination checks constraints when it loads data. The default value of this property is true.
- Rows per batch
-
Specify the number of rows in a batch. The default value of this property is –1, which indicates that no value has been assigned.
- Maximum insert commit size
-
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 sizeoption 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.
- Keep identity
-
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.
- Keep nulls
-
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.
- Table lock
-
Specify whether the table is locked during the load. The default value of this property is false.
- Check constraints
-
Specify whether the task checks constraints. The default value of this property is false.
- Rows per batch
-
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.
- Maximum insert commit size
-
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 sizeoption 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.
- Build query
-
Use the Query Builder dialog box to construct the SQL query visually.
- Browse
-
Use the Open dialog box to locate the file that contains the text of the SQL query.
- Parse query
-
Verify the syntax of the query text.
OleDB Destination 用法
标签:jpg 配置 需要 keep ant sel ora ice from
本文系统来源:http://www.cnblogs.com/zhengxingpeng/p/6688061.html
内容总结
以上是互联网集市为您收集整理的OleDB Destination 用法全部内容,希望文章能够帮你解决OleDB Destination 用法所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。