OleDB Destination 用法1

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.

 

Data Access Mode Dynamic Options

Each of the settings for Data access mode displays a dynamic set of options specific to that setting. The following sections describe each of the dynamic options available for each Data access mode setting.

Data access mode = Table or view

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.

 

Data access mode = Table or view – fast load

Name of the table or view


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 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.

Data access mode = Table name or view name variable

Variable name


Select the variable that contains the name of the table or view.

Data Access Mode = Table name or view name variable – fast load)

Variable name


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 size option to 2147483647.

Data access mode = SQL command

SQL command text


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.

时间: 2024-11-07 22:33:30

OleDB Destination 用法1的相关文章

OleDB Destination 用法

第一部分:简介 OleDB Destination component 是将数据流load 到destination,共有5种Data Access Mode,一般的Destination component 内部实现的原理是使用 insert 语句将数据插入到 target table 中. 如果 OleDB Destination component 选中的 Data Access Mode 使用 Fast load 选项,那么组件使用的 sql command 发生变化,由insert 变

SSIS: 一步步教你在SSIS 中使用临时表

需求: 存在 A 和 B 两个数据库,他们都存在 一个 T1 表,A 数据库的T1 表是源, B数据库的T1表是目的,我们要使 两个表保持同步,即:A.T1存在, B.T1 表不存在则插入. 解决方案: 1.在B 数据库中创建一个临时表 TestTmp,存储 A.T1 中的数据 2.比较 B.TestTmp和 B.T1的数据 如果一条记录在B.TestTmp存在,B.T1不存在,则将此记录插入到 B.T1表中. 声明: 用 SSIS2015数据库代替 A数据库. 用TSQL2012数据库可以代替

SSIS 如何处理column的nullability

今天遇到一个Error,details是在向OLE DB Destination的中Columns[FullName]插入数据时,违反了完整性约束. [OLE DB Destination [12]] Error: There was an error with OLE DB Destination.Inputs[OLE DB Destination Input].Columns[FullName] on OLE DB Destination.Inputs[OLE DB Destination

在Package中处理 bit column

SQL Server没有boolean类型,使用bit 类型来代替,bit类型有两个值:0 和 1. SSIS package中有boolean类型,SSIS自动将bit 类型转换成boolean类型,将 1 转换成 True,0 转换成False.在SSIS Package中,如果Table column 的 data type 为 bit,那么Package在输出时自动进行转化,将 1 转换成 True,0 转换成False. A bit value is either 0 or 1.A b

Microsoft ACE OLEDB 12.0概念及用法

首先需要清楚几个概念: Database engine(数据引擎):一些预先存储于数据库中的组件: Microsoft JET (Joint Engine Technology):Microsoft Jet 数据引擎,1992年发行初版,主要运用于 Microsoft Accesss的数据连接,Jet引擎,仅能访问 Office97-2003: Microsoft ACE(Office Access Connectivity Engine ):随着Access 2007发布之后, Microso

keytool/JDK 秘钥证书工具用法解析

keytool是一个基于jdk的秘钥证书工具: 在上一篇tomcat集成ssl中,我们使用了keytool生成了.keystore秘钥文件,此篇我们就来介绍下该工具. 先看下前篇的用法 1.keytool生成.keystore,密码及关键信息请自行补足 keytool -genkey -alias tomcat -keyalg RSA -keystore /home/tomcat/.keystore -dname "CN=***,OU=***,O=***,L=SHANGHAI,ST=SH,C=C

netstat 的10个基本用法

Netstat 是一款命令行工具,可用于列出系统上所有的网络套接字连接情况,包括 tcp, udp 以及 unix 套接字,另外它还能列出处于监听状态(即等待接入请求)的套接字.如果你想确认系统上的 Web 服务有没有起来,你可以查看80端口有没有打开.以上功能使 netstat 成为网管和系统管理员的必备利器. netstat - 打印网络连接.路由表.连接的数据统计.伪装连接以及广播域成员. 1. 列出所有连接 第一个要介绍的,是最简单的命令:列出所有当前的连接.使用 -a 选项即可. $

Android Bitmap 用法总结

android Bitmap用法总结 Normal 0 7.8 磅 0 2 false false false MicrosoftInternetExplorer4 1.Drawable → Bitmap public static Bitmap drawableToBitmap(Drawable drawable) { Bitmap bitmap = Bitmap .createBitmap( drawable.getIntrinsicWidth(), drawable.getIntrinsi

OleDbCommand 的用法

OleDbCommand 的用法 OleDbConnection con=new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data source=data.mdb");con.Open();OleDbCommand dc=new OleDbCommand("select name from us where id=2", con);textBox1.Text=dc.ExecuteScalar().ToSt