Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using Transactions interactively as an undo
Message
From
20/04/2007 16:26:34
Keith Payne
Technical Marketing Solutions
Florida, United States
 
General information
Forum:
Microsoft SQL Server
Category:
Database management
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01218073
Message ID:
01218490
Views:
18
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
>>
>>
Previous
Reply
Map
View

Click here to load this message in the networking platform