 |
|
SQL Server Tips by Burleson |
ODS API
To create an XP that does something useful, an XP must link to the
ODS DLL “Opends60.lib”. This DLL exposes the ODS API that SQL Server
uses to communicate with your XP and vice versa.
What follows is a simplified description of the functions which this
DLL exposes and which your XP can call to perform its work. It
describes the basic functionality exposed by each function, meaning
that you should refer to the MSDN documentation for detailed
information on the flags and parameters available. The discussion
only covers the functions that are used for XP's and which are fully
supported In SQL Server 2000.
Most of the functions exposed by this DLL take a SRV_PROC pointer.
This should be the same value, which is passed to your XP’s main
function. This pointer is called a “connection handle” and is an
opaque data structure that SQL Server uses to communicate
information between itself and your XP. This structure is not
documented in any ODS header file, and just like a HANDLE in Win32
programming, it should be treated as opaque. We can well imagine
that any ODS functions which takes a SRV_PROC parameter will
internally query this structure in some way and return results back
to us in our XP.
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 |