Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using Transactions interactively as an undo
Message
De
20/04/2007 16:26:34
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Maintenance bases de données
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01218073
Message ID:
01218490
Vues:
19
Evan,

It's really easy. Type COMMIT (or ROLLBACK) into the same query window (same connection) as the rest of your interactive stuff, highlight it, and execute it (F5).

>I want to do the changes interactively, not with code.
>
>>
>>BEGIN TRANSACTION T1
>>
>>   Update and Verify Data here
>>
>>if (Data Verified)
>>   COMMIT TRANSACTION T1
>>else
>>   ROLLBACK TRANSACTION T1
>>
>>
>>
>>You may also Nested Transaction like this
>>
>>BEGIN TRANSACTION T1
>>
>>  BEGIN TRANSACTION T2
>>
>>   Update and Verify Data here
>>  if (Data Verified)
>>     COMMIT TRANSACTION T2
>>  else
>>     ROLLBACK TRANSACTION T2
>>
>>
>>
>>if (Data Verified)
>>   COMMIT TRANSACTION T1
>>else
>>   ROLLBACK TRANSACTION T1
>>
>>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform