由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - Need help on a strange SQL server problem
相关主题
请教teradata问题求解释
Import 50GB data from multiple .txt file into MS SQL databasea simple question about T-SQL
MS SQL Server 的 bulk insert permissionProblem when using SQL " Insert...." to AutoNumber.
Oracle insert primary key violationQuestion on SQL Query
问个问题,请高手指教SQL Standard
自学SQL server2008用什么版本的免费软件?SQL help!
How to handle inserting value to Identity column in sql server 2005Help on Sql server huge table performance
也問 Common Table Expression 问题sql server 怎么关掉log
相关话题的讨论汇总
话题: sql话题: bulk话题: insert话题: task话题: server
进入Database版参与讨论
1 (共1页)
a******e
发帖数: 15
1
我有一个.net 程序用SqlBulkCopy 向一个SQL2008R2的表(tableA)中插入大概几百条
数据。用SQL Profiler 跟综发现所有 insert bulk 的命令都执行了,SQL Server 也
未返回任何错误。但如果用户执行
select * from tableA
有时会发现刚才插入的记录不在(不是总能重复,时有时无)。
我怀疑记录是在SQL Server Cache 中,未能及时写入硬盘,但不能肯定。
Any suggestions?
Thanks.
S*****0
发帖数: 538
2
Most likely, it is because of the transaction that the bulk insert resides,
is not commited.
http://msdn.microsoft.com/en-us/library/ms141239.aspx
The behavior of the Bulk Insert task, as it relates to transactions, depends
on whether the task joins the package transaction. If the Bulk Insert task
does not join the package transaction, each error-free batch is committed as
a unit before the next batch is tried. If the Bulk Insert task joins the
package transaction, error-free batches remain in the transaction at the
conclusion of the task. These batches are subject to the commit or rollback
operation of the package.
A failure in the Bulk Insert task does not automatically roll back
successfully loaded batches; similarly, if the task succeeds, batches are
not automatically committed. Commit and rollback operations occur only in
response to package and workflow property settings.

【在 a******e 的大作中提到】
: 我有一个.net 程序用SqlBulkCopy 向一个SQL2008R2的表(tableA)中插入大概几百条
: 数据。用SQL Profiler 跟综发现所有 insert bulk 的命令都执行了,SQL Server 也
: 未返回任何错误。但如果用户执行
: select * from tableA
: 有时会发现刚才插入的记录不在(不是总能重复,时有时无)。
: 我怀疑记录是在SQL Server Cache 中,未能及时写入硬盘,但不能肯定。
: Any suggestions?
: Thanks.

g***l
发帖数: 18555
3
就几百条为什么要BULKCOPY,把数据库改成BULK-LOGGED或者FULL MODE看看
s****y
发帖数: 13
4
check isolation level, set to read committed and try again?

【在 a******e 的大作中提到】
: 我有一个.net 程序用SqlBulkCopy 向一个SQL2008R2的表(tableA)中插入大概几百条
: 数据。用SQL Profiler 跟综发现所有 insert bulk 的命令都执行了,SQL Server 也
: 未返回任何错误。但如果用户执行
: select * from tableA
: 有时会发现刚才插入的记录不在(不是总能重复,时有时无)。
: 我怀疑记录是在SQL Server Cache 中,未能及时写入硬盘,但不能肯定。
: Any suggestions?
: Thanks.

1 (共1页)
进入Database版参与讨论
相关主题
sql server 怎么关掉log问个问题,请高手指教
请教SQL自学SQL server2008用什么版本的免费软件?
Oracle Group and Index questionHow to handle inserting value to Identity column in sql server 2005
有趣的Join问题,源于SQL和SAS比较。也問 Common Table Expression 问题
请教teradata问题求解释
Import 50GB data from multiple .txt file into MS SQL databasea simple question about T-SQL
MS SQL Server 的 bulk insert permissionProblem when using SQL " Insert...." to AutoNumber.
Oracle insert primary key violationQuestion on SQL Query
相关话题的讨论汇总
话题: sql话题: bulk话题: insert话题: task话题: server