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



In the below query i have performed the commit transaction statement but still the values after the ..

Answer / 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

More SQL Server Interview Questions

can a database be shrunk to 0 bytes, if not, why? : Sql server administration

0 Answers  


Your sql server is running out of disk space. You notice that there are several large files with ldf extensions what are these files?

0 Answers  


What are different types of raid configurations? : SQL Server Architecture

0 Answers  


How do you open a cluster administrator?

0 Answers  


What is mean by dml?

0 Answers  






is there more the two primary key in a single table?

26 Answers   Eforce, Systematix,


how can a database be repaired? : Sql server administration

0 Answers  


Can sql server be linked with other servers like oracle?

0 Answers  


how to get 25th row in any table in sqlserver can u tell me syntax

8 Answers  


How to create a stored procedure with a statement block in ms sql server?

0 Answers  


Why functions are used in sql server?

0 Answers  


how to take backup bcp out for a column in table in sql server?

0 Answers  


Categories