Begin, Commit tran - tran count not matched

Begin, Commit tran - tran count not matched

Post by Deep » Thu, 16 Dec 1999 04:00:00



I have Three Begin tran and commit tran in the Stored procedure
In each tran - A lot of insert, update (Call SP and simple insert)
          if any statement fails, doing rollback
                 and going to a label that delete the row
                Now, Start over again ( select next row and go in SP)
Ran first time, got message, previous count = 0, current counr =60
Fixed again
      Now, every thing matched, RAN AGAIN
      got message, previous count = 0, current count = 30

Still tran count not matching

ANY HELP

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

1. Begin Tran-Commit Tran

I know that even if you have nested Begin and Commit trans, rollback
will roll back everything within the outermost begin commit.

I am processing about 200,000 records so I wanted to commit every 1000,
and I have a construct like the following:

Counter=0
Begin tran
start while loop
    counter=counter+1

    if counter=1000
        commit tran
        counter = 0
        begin tran
   endif

  ---process records
end while
commit tran

I expected it to commit for every 1000 records and start a new
transaction for next 1000. My procedure bombed and it seems it is
rolling back all the records. It is meant to be that way in SQL, has
anyone tried commiting by parts.

For me, since I am commiting and starting a new transaction, it is not
nested transaction. Because commit comes before another begin. Why isn't
it working the way it is supposed?

--
Shailesh Khanal

2. exit button

3. begin tran and commit tran

4. Access 7.0, embedded GIF file

5. BEGIN TRAN and COMMIT TRAN from a three tier system

6. DAO pblm with memo fields

7. Help: multiple calls and BEGIN TRAN....COMMIT TRAN

8. OLAP SP2 problem

9. Help: simultaneous calls of a SP containing BEGIN TRAN....COMMIT TRAN

10. begin tran / commit tran

11. begin/end begin tran/commit in while

12. Programmatic BEGIN TRAN, ROLLBACK and COMMIT

13. Performance realted to begin/commit tran