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 defragment indexes with alter index ... Reorganize?
Explain indexes disadvantages?
What is a trace frag?
mention different types of relationships in the dbms?
Why we should not use triggers?
When we should use @@error?
What's the difference between a primary key and a unique key?
What is the Query of getting last 10 transaction Reports (like insert, update, Delete Data from Tabele) ?
wht's the differece between sqlserver05 and sqlserver2000
What is Right Outer Join?
What happens if the update subquery returns multiple rows in ms sql server?
Can I recover a damaged SQL Server 2008 database with the undamaged .mdb and .ldf files?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)