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
Explain how long are locks retained within the repeatable_read and serializable isolation levels, during a read operation with row-level locking?
What are the five major components of a dbms?
How to use subqueries with the in operators in ms sql server?
What are the different types of backups avaialabe in sql server 2005?
What is an index. What are the types?
Describe the left outer join & right outer join. : sql server database administration
What is the beast way to write CTE in SQL Server ?
What is ms sql server reporting services?
Explain in brief how sql server enhances scalability of the database system?
Can sub report data source be different from that of the parent report?
What are pages and extents? : SQL Server Architecture
What is nested transaction?
What are rest-style architecture's?
How to get all stored procedures in sql server?
Recommend an approach to ensuring that all changes in the remote databases synchronize with the SQL Azure database?