Home > Database > Mysql Tutorial > 在 SQL Server 中获取客户端连接的 IP 地址

在 SQL Server 中获取客户端连接的 IP 地址

WBOY
Release: 2016-06-07 14:55:10
Original
1427 people have browsed it

无详细内容 SQL Server CREATE FUNCTION [dbo].[GetCurrentIP] ()RETURNS varchar(255)ASBEGIN DECLARE @IP_Address varchar(255); SELECT @IP_Address = client_net_address FROM sys.dm_exec_connections WHERE Session_id = @@SPID; Return @IP_Address;EN

SQL Server
CREATE FUNCTION [dbo].[GetCurrentIP] ()
RETURNS varchar(255)
AS
BEGIN
    DECLARE @IP_Address varchar(255);
 
    SELECT @IP_Address = client_net_address
    FROM sys.dm_exec_connections
    WHERE Session_id = @@SPID;
 
    Return @IP_Address;
END
Copy after login
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template