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

Why is the need for data conversion transformations?

0 Answers  


Explain basic SQL queries with SELECT from where Order By, Group By-Having?

3 Answers   TetraSoft, Wipro,


When you use @@error and try-catch?

0 Answers  


What is inline variable assignment?

0 Answers  


What is the difference between indexing and hashing?

0 Answers  






how can a database be repaired? : Sql server administration

0 Answers  


What is mean by dml?

0 Answers  


Tell me what is fill factor?

0 Answers  


What is the joins and how many types of Joins in sql server a diffrentiate ever one give a suaitable query

2 Answers   Apollo,


Explain indexing and what are the advantages of it?

0 Answers  


how to find the particular row in table?(means suppose one table contain 10 rows , in these 10 rows how to find the particular row(example in 10 rows i want 5 row how)?

16 Answers   Accenture, IBM, Marlabs,


What is the difference between insensitive and scroll cursor?

0 Answers  


Categories