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 / 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 |
How to use “drop” keyword in sql server and give an example?
how can you check the level of fragmentation on a table? : Sql server administration
What are the advantages of using third-party tools?
How can I tell if sql server is 32 or 64 bit?
When cursors are useful?
Explain the advantages of merge replication?
Is candidate a key?
Explain difference between control flow and data flow?
How to receive returning result from a query?
Diffrence between DTS vs SSIS
What is the difference between stored procedure and functions?
What is difference between standardization and normalization?