join the MSSQLTips community

MSSQLTips.com - your daily source for SQL Server tips

Google
 
Web mssqltips.com

 
How to revert back the change - MSSQLTips

MSSQLTips

MSSQLTips.com - your daily source for SQL Server tips
Welcome to MSSQLTips Sign in | Join | Help
in Search

How to revert back the change

Last post 07-22-2009 5:13 PM by aprato. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-01-2009 1:12 AM

    How to revert back the change

    Hello SQL Experts

     One of my friends had to update the changeid of one user(userid =1000) to 100. But while updating he forgot to include "begin tran .. commit\rollback" and missed to include the "where ..." statement and it updated aginst all the users with changeid as 100.

     

    Is there any way to rolback this change?

    begin tranupdate tableset changeid = 100where userid = 1000commit 

     

    Please assist.

     

    Regards

    Sourav 

     

  • 07-22-2009 8:18 AM In reply to

    • Itamar
    • Top 150 Contributor
    • Joined on 02-19-2009
    • Posts 4

    Re: How to revert back the change

     Did you find a way to fix it ?

    For next time, I can offer  atool for SQL  Version Control - It shifts the responsibility for versioning from the users to the software. Its light-weight, easy to use tool that runs in the background and keeps track of all your databases schema and data changes over time, and enables full review of databases' history, and full rollback to any point in time, as well as optionally push changes into existing systems (Subversion, SourceSafe or Team Foundation Server).

  • 07-22-2009 5:13 PM In reply to

    • aprato
    • Top 10 Contributor
    • Joined on 12-01-2007
    • Greater Boston
    • Posts 594

    Re: How to revert back the change

     You've committed the change so now it's hardened to the database.  You can't undo it without issuing another update statement to re-change the value.   

Page 1 of 1 (3 items)