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
Can we add our custom code in ssis?
Difference Between ORDER BY Clause and GROUP BY Clause in SQL?
What is a trigger in sql server?
You want to use a perspective in an mdx query. How do you select the perspective?
Does partitioning improve performance sql server?
How to create an index on an existing table in ms sql server?
When I delete any data from a table, does the sql server reduce the size of that table?
What is data mart? : sql server analysis services, ssas
What is the use of partition by in sql server?
What is openrowset sql server?
What is the difference between sdf and mdf?
What is indexed view?
What does indexation mean?
How to test subquery results with the exists operator?
How can you find out which stored procedures are recompiling?