srv_getbindtoken (Extended Stored Procedure API)

ms164625.note(ko-kr,SQL.90).gif중요:
Microsoft SQL Server의 이후 버전에서는 이 기능이 제거됩니다. 새 개발 작업에서는 이 기능을 사용하지 말고, 현재 이 기능을 사용하는 응용 프로그램은 가능한 한 빨리 수정하십시오. Use CLR integration instead.

Obtains a bind token of the transaction in the current client session that invokes the extended stored procedure.

The extended stored procedure can then use sp_bindsession to bind any new session it creates against the same server to the existing transaction so that the new session can share the same transaction lock space with the client session that invoked the extended stored procedure.

구문


int srv_getbindtoken (
SRV_PROC*
srvproc
,
char*
bindtoken
);

Arguments

  • srvproc
    Is a pointer to the SRV_PROC structure that is the handle for a particular client connection. The structure contains all the information that the Extended Stored Procedure API library uses to manage communications and data between the application and the client.
  • bindtoken
    Is a pointer to a buffer where the bind token will be copied. The bind token is represented as a null-terminated string. The buffer you specify should be at least 255 bytes in length.

Returns

SUCCEED or FAIL.

주의

To bind an extended stored procedure session to the client session that called it so they share the same transaction lock space

  1. The extended stored procedure calls svr_getbindtoken to get the bind token for the current transaction in the session. The token is returned in the given bindtoken parameter.

  2. The extended stored procedure opens new session(s) against the same server. Inside that session, the extended stored procedure uses the bind token with sp_bindsession to bind the new session to the same transaction. The extended stored procedure can create multiple sessions and bind all the sessions to the same transaction.

  3. A bound session is unbound when the external stored procedure returns or when sp_bindsession is called with an empty string.

    [!참고] Only one bound session at a time can have access to a shared connection. If one session is currently executing a statement at the server or has results pending from the server, no other sessions sharing the same bound connection can gain access to the server until the current session has finished executing the current statement. If a session attempts to gain access to the connection while the server is busy, an error is returned to the conflicting session indicating the connection is in use and the session should retry later.

ms164625.security(ko-kr,SQL.90).gif보안 정보:
You should thoroughly review the source code of extended stored procedures, and you should test the compiled DLLs before you install them on a production server. For information about security review and testing, see this Microsoft Web site.

참고 항목

관련 자료

sp_bindsession(Transact-SQL)
sp_getbindtoken(Transact-SQL)

도움말 및 정보

SQL Server 2005 지원 받기