How do we rollback the table data in SQL Server

Answer Posted / elumalai.k

begin transaction
save transcation t
delete from tablename where id=2
select * from tablename
------------------------------------------------------
the value id=2 will be deleted in the tablename
-------------------------------------------------------
rollback transcation t
select * from tablename
---------------------------------------------------------
if u give rollback the deleted values will be seen again

Is This Answer Correct ?    22 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

explain different types of cursors? : Sql server database administration

556


Why SQL Agent is used?

594


Do you know what are the restrictions applicable while creating views? : SQL Server Architecture

546


How to grant a permission in ms sql server using "grant execute" statements?

559


What are “lock” hints?

583






What is shared lock?

483


How to Update from select query in sql server?

537


What are the system database in sql server 2005?

547


How many columns can exist together per table?

699


What are different types of constraints?

505


Tell me about builtinadministrator?

558


What do you understand by sql server agent?

523


What is application role in sql server database security? : sql server security

546


What are Row versions of DataRow?

599


what is create database syntax? : Sql server database administration

597