Posts

Showing posts from July, 2014

Get server IP Address in sql server

BEGIN
   DECLARE @IP_Address varchar(255);

   SELECT @IP_Address = client_net_address
   FROM sys.dm_exec_connections
   WHERE Session_id = @@SPID;

  print @IP_Address;
  END