GET_FILESTREAM_TRANSACTION_CONTEXT (Transact-SQL)

SQL Server 2012

Returns a token that represents the current transaction context of a session. The token is used by an application to bind FILESTREAM file-system streaming operations to the transaction. For a list of FILESTREAM topics, see Binary Large Object (Blob) Data (SQL Server).

The transaction must be explicit. Use BEGIN TRANSACTION followed by COMMIT TRANSACTION or ROLLBACK TRANSACTION.

When you call GET_FILESTREAM_TRANSACTION_CONTEXT, the caller is granted file system access to the transaction for the duration of the transaction. To allow another user access to the transaction through the file system, use EXECUTE AS to run GET_FILESTREAM_TRANSACTION_CONTEXT as the other user.