Re: begin tran issues



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?



.



Relevant Pages

  • Re: Is Interbase still thriving?
    ... short of reengineering the whole SQL and database structure around ... But, considering, as I said, that DB2, Sybase ASE and MS SQL shares ... this approach to transaction consistency, do you really think it could ... Oracle DB. ...
    (borland.public.delphi.non-technical)
  • Re: Update withou transaction log?
    ... transaction, for example by setting 'set rowcount 10000'? ... Certified Sybase Professional DBA for ASE 12.5/12.0/11.5/11.0 ... "The Complete Sybase Replication Server Quick Reference Guide" ... "The Complete Sybase ASE Quick Reference Guide" ...
    (comp.databases.sybase)
  • Re: all about transaction
    ... Well, Sybase is not SQL Server, though they do have the same ancestry. ... list) will automatically begin a transaction if one isn't active. ... COMMIT TRAN). ...
    (microsoft.public.sqlserver.programming)
  • Re: all about transaction
    ... >>Hi Hugo thanks once again ... ... >Well, Sybase is not SQL Server, though they do have the same ancestry. ... >list) will automatically begin a transaction if one isn't active. ...
    (microsoft.public.sqlserver.programming)
  • Re: begin tran issues
    ... begin transaction statement that in order for the transaction to be ... update tblEE ... If I run this whole statement and then run a rollback statement the ... You must execute the "begin tran" statement in its own batch to ...
    (comp.databases.sybase)