The only way for a remote server to enlist in the transaction is to be the target of a distributed query or a remote stored procedure call. The sessions involved in Transact-SQL distributed transactions do not get a transaction object they can pass to another session for it to explicitly enlist in the distributed transaction. The instance of the Database Engine on ServerA is the originating controlling instance for the transaction. The stored procedure on ServerC executes a distributed query against ServerD, and then all four computers are involved in the distributed transaction. The primary way remote instances of the Database Engine are enlisted in a distributed transaction is when a session already enlisted in the distributed transaction executes a distributed query referencing a linked server.įor example, if BEGIN DISTRIBUTED TRANSACTION is issued on ServerA, the session calls a stored procedure on ServerB and another stored procedure on ServerC. Transaction-level snapshot isolation does not support distributed transactions. When a subsequent COMMIT TRANSACTION or ROLLBACK TRANSACTION statement is issued for the session, the controlling instance requests that MS DTC manage the completion of the distributed transaction across all of the instances involved. The instance of the SQL Server Database Engine executing the BEGIN DISTRIBUTED TRANSACTION statement is the transaction originator and controls the completion of the transaction. The variable must be declared with a char, varchar, nchar, or nvarchar data type. Is the name of a user-defined variable containing a transaction name used to track the distributed transaction within MS DTC utilities. transaction_name must conform to the rules for identifiers and must be <= 32 characters. Is a user-defined transaction name used to track the distributed transaction within MS DTC utilities. To view Transact-SQL syntax for SQL Server 2014 and earlier, see Previous versions documentation.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |