This topic has not yet been rated - Rate this topic

SqlTransaction.Save Method

Creates a savepoint in the transaction that can be used to roll back a part of the transaction, and specifies the savepoint name.

Namespace:  System.Data.SqlClient
Assembly:  System.Data (in System.Data.dll)
public void Save(
	string savePointName
)

Parameters

savePointName
Type: System.String
The name of the savepoint.
Exception Condition
Exception

An error occurred while trying to commit the transaction.

InvalidOperationException

The transaction has already been committed or rolled back.

-or-

The connection is broken.

Save method is equivalent to the Transact-SQL SAVE TRANSACTION statement.

The value used in the savePoint parameter can be the same value used in the transactionName parameter of some implementations of the BeginTransaction method.

Savepoints offer a mechanism to roll back parts of transactions. You create a savepoint using the Save method, and then later call the Rollback method to roll back to the savepoint instead of rolling back to the start of the transaction.

For more information on using savepoints, see "Transaction Savepoints" in SQL Server 2000 Books Online.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ