| |

VerySource

 Forgot password?
 Register
Search
View: 591|Reply: 1

Basic issues of a transaction

[Copy link]

2

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-1-9 23:40:02
| Show all posts |Read mode
declare @ number1 int
declare @ number2 int
set @ number1 = 1
set @ number2 = 2
begin transaction
select @ number1
rollback transaction
         select @ number2
commit transaction
Is this understandable? The above statements are wrong because the rollback transaction is executed first.
So the transaction has ended. And the subsequent commit transaction will not correspond to the new begin transaction (because the first begin transaction has ended), so the program will be wrong. Do you understand this?
Reply

Use magic Report

0

Threads

8

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-1-11 14:36:01
| Show all posts
Yeah. Just like what you said.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list