Click here to Skip to main content
16,004,836 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Friends,

I have connected my system in LAN for centeralized db.. How to i find IP who delete or modify the values, table, views, etc..





Thanks & Regards,
Vivek .R
Posted

1 solution

SQL
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


-------System default Query---------
SQL
SELECT CONVERT(char(15), CONNECTIONPROPERTY('client_net_address'))
 
Share this answer
 
v2
Comments
Vivek.anand34 22-Dec-15 2:04am    
I need Which Table They Modified and time, IPAddress.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900