标签:rows BatchSize object SqlBulkCopy batch data
Sql Bulk Copy Class
Batch |
Number of rows in each batch. At the end of each batch, the rows in the batch are sent to the server. |
Bulk |
Number of seconds for the operation to complete before it times out. |
Column |
Returns a collection of SqlBulkCopyColumnMapping items. Column mappings define the relationships between columns in the data source and columns in the destination. |
Destination |
Name of the destination table on the server. |
Enable |
Enables or disables a SqlBulkCopy object to stream data from an IDataReader object. |
Notify |
Defines the number of rows to be processed before generating a notification event. |
BatchSize
Remarks
A batch is complete when BatchSize rows have been processed or there are no more rows to send to the destination data source.
Zero (the default) indicates that each WriteToServer operation is a single batch.
If the SqlBulkCopy instance has been declared without the UseInternalTransaction option in effect, rows are sent to the server BatchSize rows at a time, but no transaction-related action is taken. If UseInternalTransaction is in effect, each batch of rows is inserted as a separate transaction.
The BatchSize property can be set at any time. If a bulk copy is already in progress, the current batch is sized according to the previous batch size. Subsequent batches use the new size. If the BatchSize is initially zero and changed while a WriteToServer operation is already in progress, that operation loads the data as a single batch. Any subsequent WriteToServer operations on the same SqlBulkCopy instance use the new BatchSize.
Sql Bulk Copy. Bulk Copy Timeout Property
The integer value of the BulkCopyTimeout property. The default is 30 seconds. A value of 0 indicates no limit; the bulk copy will wait indefinitely.
Remarks
If the operation does time out, the transaction is not committed and all copied rows are removed from the destination table.
Sql Bulk Copy. Enable Streaming Property
Property Value
true
if a SqlBulkCopy object can stream data from an IDataReader object; otherwise, false. The default is false
.
Remarks
When EnableStreaming is true
, SqlBulkCopy reads from an IDataReader object using SequentialAccess, optimizing memory usage by using the IDataReader streaming capabilities. When it's set to false, the SqlBulkCopy class loads all the data returned by the IDataReader object into memory before sending it to SQL Server or SQL Azure.
标签:rows,BatchSize,object,SqlBulkCopy,batch,data 来源: https://www.cnblogs.com/chucklu/p/16427081.html
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。