In the below query i have performed the commit transaction statement but still the values after the save are not saved.
Can you please let me know why are the statements after save are rolled back even after commiting the data. help me with the understanding
declare @trans2 varchar(10)='transaction2'
begin transaction @trans2
insert into emp values(100,'xy',600);
save transaction @trans2
insert into emp values(200,'pq',700);
insert into emp values(300,'pq',800);
commit transaction @trans2
rollback tran @trans2
Answer Posted / vijayalakshmi
declare @trans2 varchar(10)='transaction2'
begin transaction @trans2
insert into emp values(100,'xy',600);
save transaction @trans2
insert into emp values(200,'pq',700);
insert into emp values(300,'pq',800);
save transaction @trans2
commit transaction @trans2
rollback tran @trans2
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is the web service used for reporting services?
What is ems sql management studio? : sql server management studio
What is Extended user-defined?
John exports information periodically from a microsoft sql server database to an oracle database what is the best way to do this?
List out the difference between union and union all in sql server?
How to find the version of sql server? : sql server database administration
When to use null data driven subscription?
Explain the phases a transaction has to undergo?
how to define testing of network layers? : Sql server database administration
What is code near application topology?
What are the types of database schema? : sql server analysis services, ssas
how can u get last observation in an unknown dataset ?
Can we return Data from 4(more than 1) tables in stored procedure?
Explain how long are locks retained within the repeatable_read and serializable isolation levels, during a read operation with row-level locking?
what is the difference between Delete and Truncate command in SQL