Get application information at SQL Server level for auditing

亡梦爱人 提交于 2021-01-29 10:00:14

问题


I'm writing a SQL trigger on a table that will update an audit table upon any change to specific fields with details of old value, new value, changed by, and timestamp. That is moving along nicely.

I'm wondering if there is a way that I can write a trigger for auditing on a table in a similar fashion but I can also figure out what application executed the query on the database/table? When we write the connection string we have this App property:

...provider connection string="data source=STGPDBCLS;initial catalog=StagingDb;persist security info=True;user id=abc;password=123;MultipleActiveResultSets=True;Connect Timeout=80;App=EntityFramework&quot...

Does that play a role?

TL;DR

How to get name of application/Source that executed a query on SQL Server

来源:https://stackoverflow.com/questions/59942330/get-application-information-at-sql-server-level-for-auditing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!