سؤال

I created a trigger for auditing purposes that logs changes made to a particular table.

Is there any way for me to tell what computer the query that set the trigger off came from? I have full access to the database, but no access to software code.

هل كانت مفيدة؟

المحلول

I'd include these in your auditing:

SELECT 
    HOST_NAME()  ModifiedByHost, 
    SYSTEM_USER  ModifiedByUser,
    APP_NAME()  ModifiedByAppName

HOST_NAME() will give you the computer.

http://technet.microsoft.com/en-us/library/ms178598.aspx

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top