 |
|
SQL Server Tips by Burleson |
Security / Connection
Management
srv_getbindtoken
This function obtains a bind token so that an XP can share the same
transaction lock space as the client that called the XP. This is
useful where your XP will be manipulating some data that is also
being operated on by the client while avoiding the locks, which
would otherwise occur. For a concrete example of using this
function, please refer to the XP_ODBC example provided by MS or the
equivalent implementation called XP_ODBC++ provided with the code
samples accompanying this book.
srv_impersonate_client
This function allows you to impersonate or take on the security
credentials of the client session that called the XP. This is used
to avoid security issues, which could occur due to execution of XP
code with elevated security privileges. Its operation is similar to
the other Windows impersonation API’s such as
ImpersonateLoggedOnUser, ImpersonatedNamedPipeClient,
RpcImpersonateClient etc. Again this function is not officially
documented as part of the ODS API. For an example of its usage
please refer to the XP_ODBC example.
srv_revert_to_self
This is the corollary function to “srv_impersonate_client”. For
every call to srv_impersonate_client, you should have a matching
call to this function. Again this function is not officially
documented as part of the ODS API. For an example of its usage
please refer to the XP_ODBC example.
The above book excerpt is from:
Super SQL
Server Systems
Turbocharge Database Performance with C++ External Procedures
ISBN:
0-9761573-2-2
Joseph Gama, P. J. Naughter
http://www.rampant-books.com/book_2005_2_sql_server_external_procedures.htm |