Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using Transactions interactively as an undo
Message
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Database management
Title:
Using Transactions interactively as an undo
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01218073
Message ID:
01218073
Views:
54
I do data cleanup using the query window in SQL. Probably pretty typical. Using UPDATE commands and such. A couple of times I've made mistakes and thus I would like to have a way of undoing a data change. I tried adapting the first code sample from

http://msdn2.microsoft.com/en-us/library/ms190295.aspx

By breaking it up so that I execute each part seperatly below. Which I hoped would work.

BEGIN TRANSACTION < then clicking the execute button >

UPDATE SET id = 14 WHERE ID = 27 < then clicking the excute button >

* then reviewing my changes

COMMIT TRANSACTION < then clicking the execute button >

Not suprizingly I get the message "The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION

Is there a way to wrap commands in a transaction (or with another method) so that I can interactively verify my change before committing it?
Next
Reply
Map
View

Click here to load this message in the networking platform