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 are the different types of collation sensitivity?
How to create a new login name in ms sql server?
Explain different forms of normalization?
What are out-of-range errors with date and time literals?
Can you use order by when defining a view?
What is t-sql script to take database offline – take database online.
explain the storage models of olap? : Sql server database administration
What is explicit cursors?
Is sql server free?
Hi, I Created 3 Tables Person(PersID[prkey],Name,Email,Password), Project(ProjName,ProjID[prkey],ProjLeader,ProjManager) & ProjectInvolvement(EntryDate,ProjID[frkey],PersID[frkey],ProjDuration). For this how can i INSERT,UPDATE & DELETE Through PROCEDURE? Please Post the Answer for me. Desai.
What is the difference between mysql and mysqli?
What are the steps to insert a table?
What is log shipping?
What are cursors? Explain different types of cursors. What are the disadvantages of cursors? How can you avoid cursors?
How to convert character strings into numeric values?