I am writing a trigger to audit updates and deletes in tables. I am using SQL Server 2008
My questions:
Is there a way to find out what actions are taken in a record without going through the step of selecting deleted and inserted tables?
Another question: if the record is deleted, how can I record in the audit table of the user performing the deletion. (NOTE: A user connected to the database is a common connection string with the specified user, I need a user who is registered in a web application or a Windows application).
Please, help?
, , INSERTED DELETED .
INSERTED
DELETED
, , - web/windows. , , , .
, "LastModifiedBy" , , . . , , , -, , , .
, , , , . , , . , .
, , - , IsDeleted , , . , isdelted null.
. , , , . ( , dba, - ), , dba, . , . , , , . .
, , //. .
roufamatic, , , INSERTED DELETED.
, , . , , , , SET CONTEXT_INFO CONTEXT_INFO(), . , SET CONTEXT_INFO, , CONTEXT_INFO(). , . , SET CONTEXT_INFO . , . , - , , USERNAME() (, , , , ).
, CONTEXT_INFO , , .
, , . - CONTEXT_INFO SET CONTEXT_INFO, , , .
, , INSERTED DELETED . , - . , -
Source: https://habr.com/ru/post/1749067/More articles:Проверьте, не работает ли устройство Windows Mobile в режиме ожидания - c#Silverlight control disables / deletes events - eventsIs it possible to put myBatis (iBatis) xml mappers outside the project? - ibatisSilverlight ~ MVVM ~ Dynamically adjusts the Style property based on the model value - coding-styleMono fast enough for Mac OS X? - performanceWriting Filestream to file and reading bfile - c #Publishing a form using AJAX - postКак удалить пространство имен из XML-элемента с помощью С# - c#protocol buffers version - cross-platformgo ... to the NetConnection call - restAll Articles