hey all;
I have a statement like this
BEGIN TRANSACTION trans1
insert into auto(auto_id,aout_name)values('2','Porsche')
and after i run this ,i write
ROLLBACK TRANSACTION trans1
and it rolls back succesfully.
When i try to do the same thing with delete query like,
BEGIN TRANSACTION trans2
delete from auto where auto_id=5
it deletes the record but when i try to rollback like,
ROLLBACK TRANSACTION trans2
it gives an error like "rollback cant be done ,there is no trans2"
Guys,i guess i am doing something wrong .What is the rollback statement fro delete queries.How can we save our records by deleting with wrong logic or accidentially.Thnks.
I have a statement like this
BEGIN TRANSACTION trans1
insert into auto(auto_id,aout_name)values('2','Porsche')
and after i run this ,i write
ROLLBACK TRANSACTION trans1
and it rolls back succesfully.
When i try to do the same thing with delete query like,
BEGIN TRANSACTION trans2
delete from auto where auto_id=5
it deletes the record but when i try to rollback like,
ROLLBACK TRANSACTION trans2
it gives an error like "rollback cant be done ,there is no trans2"
Guys,i guess i am doing something wrong .What is the rollback statement fro delete queries.How can we save our records by deleting with wrong logic or accidentially.Thnks.