srv_rpcname(扩展存储过程 API)srv_rpcname (Extended Stored Procedure API)

适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) 适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions)

重要

后续版本的 Microsoft SQL Server 将删除该功能。This feature will be removed in a future version of Microsoft SQL Server. 请避免在新的开发工作中使用该功能,并着手修改当前还在使用该功能的应用程序。Avoid using this feature in new development work, and plan to modify applications that currently use this feature.请改用 CLR 集成。Use CLR integration instead.

返回当前远程存储过程的过程名称部分。Returns the procedure name component for the current remote stored procedure.

语法Syntax

  
DBCHAR * srv_rpcname (  
SRV_PROC *  
srvproc  
,  
int *  
len   
);  

参数Arguments

srvproc**srvproc
指向作为特定客户端连接句柄(在这里为接收远程存储过程的句柄)的 SRV_PROC 结构的指针。Is a pointer to the SRV_PROC structure that is the handle for a particular client connection (in this case, the handle that received the remote stored procedure). 该结构包含扩展存储过程 API 库用于管理应用程序和客户端之间的通信和数据的信息。The structure contains information that the Extended Stored Procedure API library uses to manage communication and data between the application and the client.

长度len
指向接收数据库名称长度的整型变量的指针。Is a pointer to an integer variable that receives the length of the database name. 如果 len 为 NULL,则不返回远程存储过程名称的长度**。If len is NULL, the length of the remote stored procedure name is not returned.

返回值Returns

一个 DBCHAR 指针,指向当前远程存储过程的远程存储过程名称部分的以 NULL 值结束的字符串。A DBCHAR pointer to the null-terminated string for the remote stored procedure name component of the current remote stored procedure. 如果当前无远程存储过程,则返回 NULL,且 len 设置为 -1**。If there is not a current remote stored procedure, NULL is returned and len is set to -1.

备注Remarks

此函数只返回远程存储过程的名称。This function returns only the name of the remote stored procedure. 不包括所有者、数据库名称和远程存储过程编号的可选说明符。It does not include the optional specifiers for owner, database name, and remote stored procedure number.

由于在无远程存储过程的情况下也可以调用 srv_rpcname(不会出现信息性错误),因此,该函数也可用于确定是否存在远程存储过程****。Because it is valid to call srv_rpcname when there is not a remote stored procedure (no informational error occurs), this function provides a method for determining whether a remote stored procedure exists.

重要

应全面检查扩展存储过程的源代码,并在生产服务器中安装编译的 DLL 之前,对这些 DLL 进行测试。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. 有关安全检查和测试的信息,请访问此 Microsoft 网站For information about security review and testing, see this Microsoft Web site.