There are some conditions when you need to rollback an implicit or explicit transaction to a given point inside the transaction. There are two ways to address such a need:

1. You can use the T-SQL to address such a problem:

SAVE TRAN savePointName
--Modify the data source

2. Use the SqlTransaction’s Save method within your code. Please note that this method is not part of the standard IDbTransaction interface and is located specifically on the SqlTransaction class:

//Mark a savepoint.
//Modify the data source

Please also note that when you rollback a transaction to a savepoint, resources are continued to be held until either the completion of the transaction or a rollback of the complete transaction. Therefore a commit or a complete rollback should always follow a rollback to savepoint.


2 Responses to SQL Server Savepoints

  1. sajjad aghapour says:

    Hi Dear Mehdi..
    I’m sajjadlove(sajjad aghapour) in Barnamenevis…
    Thank you for your useful & precious weblog…
    good luck in all fields…

  2. Seyed Abbas Hashemi says:

    hi Dear Mehdi
    I cant speak english good .. sory
    tnak you for your posts…

    tank you .. bye

Leave a Reply

Your email address will not be published. Required fields are marked *

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!