begin tran and dynamic query

begin tran and dynamic query

Post by Binn » Sat, 03 Jan 2004 21:13:21




begin transactin

rollback transaction
appreciate any help
thanks

 
 
 

begin tran and dynamic query

Post by Jacco Schalkwij » Sat, 03 Jan 2004 21:31:14


BEGIN TRANSACTION doesn't have to be a part of the dynamic SQL string to
work, it will work either way. It is important though is where it is when
you want to rollback a transaction in case of an error. In that case it is
usually better to have the begin/rollback/commit transaction outside the
dynamic SQL statement. If you want more background information about this, I
can advise you to read the article about error handling and dynamic SQL on
www.sommarskog.se.

--
Jacco Schalkwijk
SQL Server MVP



> begin transactin

> rollback transaction
> appreciate any help
> thanks


 
 
 

1. Begin, Commit tran - tran count not matched

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.

2. Help with query to rotate rows into columns - crosstab?

3. Begin Tran-Commit Tran

4. Changing a database name

5. begin tran and commit tran

6. Linked Servers

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

8. 100s of FREE books on Java

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

10. begin tran / commit tran

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

12. begin/end begin tran/commit in while

13. OLE DB Blows Out BEGIN TRAN