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
What happens on checkpoint?
What is a primary key?
How can I add Reporting Services reports to my application?
what is the maximum size of a row? : Sql server database administration
Is truncate autocommit?
Explain different backup plans?
Explain what is the difference between a local and a global temporary table?
Can you explain what are various ways to enhance the ssrs report?
What is data source view or dsv? : sql server analysis services, ssas
Is there any difference between primary key and unique with the not null condition?
How many categories of functions based their return modes?
How many types of attribute relationships are there? : sql server analysis services, ssas
What is identity?
What is subquery explain with example?
How to create user messages with print statements in ms sql server?