C# sql server 2008 r2中的查询回滚策略

C# sql server 2008 r2中的查询回滚策略,c#,sql,sql-server,sql-server-2008,C#,Sql,Sql Server,Sql Server 2008,我有一个由一些插入和更新组成的查询,类似这样 Insert Into #TempTable (...) Select top (1000) * from T where .... Update T2 Set c1=...,c2=... where w1 Update T2 Set c1=...,c2=... where w2 Update T2 Set c1=...,c2=... where w2 我从C#应用程序运行此查询。由于服务器负载过重,此查询的每个部分都

我有一个由一些插入和更新组成的查询,类似这样

   Insert Into #TempTable (...) Select top (1000) * from T where ....

   Update T2 Set c1=...,c2=... where w1

   Update T2 Set c1=...,c2=... where w2

   Update T2 Set c1=...,c2=... where w2

我从C#应用程序运行此查询。由于服务器负载过重,此查询的每个部分都可能超时,我想知道,如果查询的一部分超时(例如第二次更新),Sql server引擎将回滚之前的所有查询(插入和第一次更新)?

在代码处打开SqlConnection后,执行
SqlCommand.CommandTimeout=0,这将防止.net C#side导致的超时错误


如果使用sqlcommand创建SqlDataAdapter,请将超时设置为0,确保通过调试创建后:
SqlDataAdapter.SelectCommand.CommandTimeout=0

@raman的副本:不,不是。我不想用transaction@user1121366如果不使用事务,则无法执行回滚。