Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Select @@trancount Before/After

Author  Topic 

waifungl
Starting Member

1 Post

Posted - 2009-01-28 : 22:17:18
Hi All,

I saw the following code on Internet:

select @@trancount before
rollback tran
select @@trancount after


Could anyone elaborate on the before and after?

Thanks!

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-01-28 : 22:47:11
@@trancount will Returns the number of active transactions for the current connection.

it will return the count before the rollback & after the rollback retruns the transaction count
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-01-29 : 00:14:38
Before and After are just alias names for the returned column.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

AvanthaSiriwardana
Yak Posting Veteran

78 Posts

Posted - 2009-01-29 : 00:36:50
before and after are alias name for columns and this query will return the @@trancount before and after.

Avantha Siriwardana
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-01-29 : 00:40:09
I don't see how Avantha's post provides any extra information than what the other two people said.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

AvanthaSiriwardana
Yak Posting Veteran

78 Posts

Posted - 2009-01-29 : 03:56:35
Hi Tara.
yes you are correct since it does not show any additional information than what the other two said......i did not see peso's reply..
:)

Avantha Siriwardana
Go to Top of Page
   

- Advertisement -