Geeks With Blogs
Catherine Russell Architect, President of "Women In Information Technology" Group

I have an Oracle background. It was interesting to see how rollback handled in Oracle and SQL Server.

There is no begin trans in Oracle.  What oracle does is it will store the data in a temporary area called the rollback segments. Untill your issue the commit command the records will be kept there. You can even rollback your update statement by issuing the rollback command. When you issue the commit command the records in the rollback segments are written to the redo log files. The same logic for insert is also applicable except that there is no mirror image of the record kept.
 

In SQL Server, if you want to be able to roll back statement, you neet to start your statement with a "begin tran" .

Then, you can rollback a transaction, if this is needed.

begin tran
update Person set FirstName = 'Arthur'
where PersonId = 10

-- select firstname from Person

rollback
 

 

Posted on Tuesday, June 15, 2010 1:45 AM Tutorials | Back to top


Comments on this post: Rollback in Oracle and SQL Server

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © CatherineRussell | Powered by: GeeksWithBlogs.net