Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using Transactions interactively as an undo
Message
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Maintenance bases de données
Titre:
Using Transactions interactively as an undo
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01218073
Message ID:
01218073
Vues:
55
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?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform