srv_pfield (Extended Stored Procedure API)
This feature will be removed in a future version of Microsoft SQL Server. Do not use this feature in new development work, and modify applications that currently use this feature as soon as possible. Use CLR integration instead.
Returns information about a database connection.
DBCHAR * srv_pfield ( SRV_PROC * srvproc , int field , int * len );
Pointer identifying a database connection.
Specifies data on the connection to return.
The application name provided by the client when it established the connection.
A flag that is TRUE if the client is preparing for a bulk copy operation; otherwise, FALSE.
The name of the library that enables the client to talk to a server.
The client process ID on the client source computer.
The name of the client's machine provided by the client when it established the connection.
The version of the client library.
A flag. TRUE if the connection used integrated security to login.
The name of the Net-Library DLL used by the connection.
The version of the Net-Library DLL used by the connection.
The connection string passed to the Net-Library DLL used for the current srvproc connection.
A string containing the pipe handle of a connected client, or NULL if the client is connected on a network that does not use named pipes. To use this handle as a valid pipe handle with Microsoft Windows, convert this string to an integer.
The server from which the client process is logged in. If the login is from a client, this value is an empty string.
The number of rows already sent by srvproc for the current set of results.
The server thread ID of the srvproc. For extended stored procedures, this value is the same as the kpid column of sys.sysprocesses, and it can change over time.
Codepage that the server uses to interpret multbyte data.
The current status of srvproc: running or closed
The connection type of srvproc. If server is returned, srvproc is from an instance of SQL Server. If client is returned, srvproc is from a DB-Library or ODBC client.
The user name of the connection.
Is a pointer to an int variable that contains the length of the returned field value. If len is NULL, the length of the string is not returned.
A pointer to a null-terminated string containing the current value for the specified field in the SRV_PROC structure. If the field is empty, a valid pointer to an empty string is returned and len contains 0. If the field is unknown, NULL is returned and len contains the value -1.
|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.|