Roll back

  • Hi Buddy's

    This is lee

    1). I opend a newquery window

    2). I updated one row

    how to roll back it. Before that I didn't given begint tran.

    Regards

    lee

  • You can't. If you did not start an explicit transaction, then the changes were committed as soon as the statement completed and no rollback is possible

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Did you just change one row? You are lucky, Just revert back the value.

    You can restore the database to the earlier time but since its only one row, I would not be bothered

  • [font="Verdana"]

    Lee From Bangalore (2/5/2009)


    Hi Buddy's

    This is lee

    1). I opend a newquery window

    2). I updated one row

    how to roll back it. Before that I didn't given begint tran.

    Regards

    lee

    Always follow:

    Begin

    Begin Transaction

    Update / Delete / Insert Statement

    If @@Error

    Begin

    RollBack Transaction

    Error Handling

    End

    Commit Transaction

    End

    Mahesh

    [/font]

    MH-09-AM-8694

  • Hi,

    You need to Transaction Blocks to do it. By default if run any queries in Query Window , all of them are implicit commit.

    You need to follow Mahesh's code to achieve.

    Thanks

    Vijaya Kadiyala

    http://dotnetvj.blogspot.com

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply