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 if the update subquery returns multiple rows in ms sql server?
How can we improve performance by using SQL Server profiler?
List the ways in which dynamic sql can be executed?
How do I setup a sql server database?
How much does sql server 2016 cost?
Please illustrate physical database architecture? : SQL Server Architecture
Explain what is public role in sql server?
What are ddl triggers and types of ddl trigger?
Can you import Microsoft Excel data to SSRS?
How to find out what is the default collation in a database?
what is a live lock? : Sql server database administration
Why should we go for stored procedures? Why not direct queries?
What is BLOCK statements in SQL?
Tell me what is the significance of null value and why should we avoid permitting null values?
What is the full form of dql?