Developing which application modifies the sql database value

I have a problem when an outdated database that many applications read / write is constantly changing, and I can’t understand what is changing it.

My application changes a certain value in a certain row of the table, but something continues to change it after a week or so, and I'm at a standstill to understand what it could be.

Is it possible to somehow associate an event / trigger with this value, and then save or send information about what changed it? or at least at what time it was changed?

+3
source share
1 answer

, Application Name . .

, . app_name() . :

create trigger Tracker
on TableName
after insert, update, delete 
as
    insert LogTable(TableName, ApplicationName)
    values('TableName', app_name())
go

, , system_user .

, , IP-. select client_net_address from sys.dm_exec_connections where session_id = @@SPID.

, .

.

+4

All Articles