To obtain the IP of the client that executes the current query you can execute the following line:
SELECT client_net_address FROM sys.dm_exec_connections WHERE session_id = @@SPID;