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


Please Help Members By Posting Answers For Below Questions

Explain how long are locks retained within the repeatable_read and serializable isolation levels, during a read operation with row-level locking?

855


What are the five major components of a dbms?

656


How to use subqueries with the in operators in ms sql server?

739


What are the different types of backups avaialabe in sql server 2005?

760


What is an index. What are the types?

739






Describe the left outer join & right outer join. : sql server database administration

737


What is the beast way to write CTE in SQL Server ?

749


What is ms sql server reporting services?

705


Explain in brief how sql server enhances scalability of the database system?

674


Can sub report data source be different from that of the parent report?

121


What are pages and extents? : SQL Server Architecture

698


What is nested transaction?

734


What are rest-style architecture's?

163


How to get all stored procedures in sql server?

657


Recommend an approach to ensuring that all changes in the remote databases synchronize with the SQL Azure database?

122