Re: begin tran issues
- From: "Rob Verschoor" <rob@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 11 Jul 2007 22:34:18 +0200
What you're describing at the start of your post is indeed how transactions
work.
Try this:
- run a select before the begin tran todisply the current values of 'status'
- after every statement (incl. begin tran and the commit), run 'select
@@trancount' -- this will tell you whether you're in a transaction or not
- if that doesn't point you to the problem, check if the table has any
triggers that do funny things (I don't expect that though)
- also check if you're running unchained Xact mode ('select @@chained').
HTH,
Rob V.
-------------------------------------------------------------
Rob Verschoor
Certified Sybase Professional DBA for ASE 12.5/12.0/11.5/11.0
and Replication Server 12.5 / TeamSybase
Author of Sybase books (order online at www.sypron.nl/shop):
"Tips, Tricks & Recipes for Sybase ASE" (new edition!)
"The Complete Sybase ASE Quick Reference Guide" (new edition!)
"The Complete Sybase Replication Server Quick Reference Guide"
mailto:rob@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
http://www.sypron.nl
Sypron B.V., P.O.Box 10695, 2501HR Den Haag, The Netherlands
-------------------------------------------------------------
"YALTA" <gchenault@xxxxxxxxx> wrote in message
news:1183928757.382982.25210@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I am having a issue with sybase! It is my understanding that in any
statement mainly a delete or a update statement where one would use a
begin transaction statement that in order for the transaction to be
finished and unlock the table a commit statement needs to be run. For
example:
Employee_id: 1 has a status of 1 for active, I want to make it 0 or
inactive and the tbl is tblEE and both values are int
Begin tran
update tblEE
set status = 0
where Employee_id = 1
If I run this whole statement and then run a rollback statement the
status should stay 1. I am running this statement getting a result
saying one record has been update in .0016 seconds. I type rollback
run the rollback statement and I get a output saying: execution time 0
seconds. I check the EE in the table and the status is zero. What am I
doing wrong?
.
- References:
- begin tran issues
- From: YALTA
- begin tran issues
- Prev by Date: Re: update question
- Next by Date: Re: does bcp out lock the table?
- Previous by thread: Re: begin tran issues
- Next by thread: update question
- Index(es):
Relevant Pages
|
|