Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
HI Frnds,
I have updated the sql table values by using C# .net windows application.I need to roll back to old values...how to rollback it in sql server 2008 using query
Posted

1 solution

SQL
Begin try
  Begin Tran
  Your Query lies here  

  Commit Tran
End TRY

Begin Catch
  Rollback Tran
  Return
End Catch
 
Share this answer
 
Comments
itsureshuk 7-Nov-12 7:04am    
I have used C# page with Update query which updates all rows (30 rows)...Now I need that old values in 30 rows
kankeyan 7-Nov-12 7:09am    
Once the transaction is commiteed it not possible while transaction only we can do. Otherwise if u have Log Files try to Rollback from that With the help of DB Admin
itsureshuk 7-Nov-12 8:08am    
k

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900