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

You are doing log shipping due to some reasons it is failing. How you will proceed from there

0 Answers  


What is the size of transaction log file?

0 Answers  


How can we delete a table in sql server?

0 Answers  


How to know whether our backup is succesfully taken?

1 Answers  


what operator performs pattern matching?

2 Answers  






explain the type of contraints

3 Answers  


How to create user messages with print statements in ms sql server?

0 Answers  


In one interview...interviewer ask me question pleas tell me sql server architecture.. can any body tell me the sql server architecture with digram

0 Answers  


Explain about merge replications?

0 Answers  


explain extended properties

0 Answers  


What is standby servers? Explain types of standby servers.

0 Answers  


How to enter binary string literals in ms sql server?

0 Answers  


Categories