title: How to get the client IP address from SQL Server 2008 itself?
body: <p>I have a trigger for insert/update/delete. That is working fine. Also, I need the client's IP address from where the changes are made. That I need in T-SQL, that means, not in any web form but in the SQL/T-SQL while my trigger will get fired.</p>
  <p>Also I go-ogled, and got that there is stored procedure in master database named <code>xp_cmdshell</code> which when executed with <code>ipconfig</code> we can get the IP Address. I think this will work only when you have administrative access to database. Mine hosting is a shared hosting , so I don't have such privilege. Is there any other way out?</p>
  <p><strong>Please note</strong>: I don't have administrative privileges on my SQL Server 2008 database. I need a solution as an authenticated user.</p>
  <p><strong>Another update:</strong></p>
  <p>I have got the solution, the query that will work for my scenario is</p>
  <pre><code>SELECT hostname, net_library, net_address
  FROM sys.sysprocesses 
  WHERE spid = @@SPID
  </code></pre>
  <p>It executes as needed but there is only one issue, that net_address is not in IP format. below is mine result:</p>
  <pre><code>hostname    net_library     net_address
  IPC03       TCP/IP          AE8F925461DE  
  </code></pre>
  <p>I am eager to know:</p>
  <ol>
  <li><p>What is net_address here? Is is MAC Address or Some IP address etc?</p>
  </li>
  <li><p>Is there any way to convert net_address to ip?</p>
  </li>
  </ol>