首页 新闻 会员 周边 捐助

关于SQL隐式事务的问题???????

1
悬赏园豆:50 [待解决问题]

Set Implicit_transactions ON
PRINT @@TRANCOUNT
SELECT * FROM ORDERS
PRINT @@TRANCOUNT
COMMIT TRAN
--SELECT * FROM ORDERS
PRINT @@TRANCOUNT
BEGIN TRAN
PRINT @@TRANCOUNT
ROLLBACK TRAN
PRINT @@TRANCOUNT

 

---------------

0

(1 row(s) affected)
1
0
2
0

 

如何解释@@TRANCOUNT从0一下变成2???

NET_LOVER的主页 NET_LOVER | 初学一级 | 园豆:150
提问于:2011-10-21 22:13
< >
分享
所有回答(1)
0

帮顶

 

Set Implicit_transactions ON
PRINT @@TRANCOUNT
SELECT * FROM ORDERS
PRINT @@TRANCOUNT
COMMIT TRAN
--SELECT * FROM ORDERS
PRINT @@TRANCOUNT
BEGIN TRAN
PRINT @@TRANCOUNT
commit  TRAN
PRINT @@TRANCOUNT

这时是

1
0
2
1

JentleWang | 园豆:160 (初学一级) | 2011-10-22 20:16
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册