views:

44

answers:

1

Dear All,

How to determine if a Transaction is active i.e. before issuing Begin Transaction I want to ensure that no previous transaction are open.. the platform is VB6, MS-SQL Server 2000 and ADO 2.8

+5  A: 

You can check the @@TRANCOUNT variable, for the current connection to the database. It gets incremented by 1 every time a transaction is opened.

http://msdn.microsoft.com/en-us/library/aa933178%28SQL.80%29.aspx

Dan S
+1 For Khalid, you can retrieve this with a SELECT @@TRANCOUNT
Andomar