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 is merge statement?
What is the size of transaction log file?
What is Federation and Federation Member?
Can you always create a cache of a report?
Which joins are sql server default?
Mention the uses of stored procedures.
Please explain what is “asynchronous” communication in sql server service broker?
Explain view in sql server?
What is an expensive query?
What are the types of database recovery models?
what is the main function of a query parameter?
What is sql server 2000 work load governor?
Can the query output be sorted by multiple columns in ms sql server?
Your sql server is running out of disk space. You notice that there are several large files with ldf extensions what are these files?
How do we Backup SQL Azure Data?