Passing Client Machine IP Address to SQL on Existing queries without adding as Parameter - SQL

StackOverflow https://stackoverflow.com/questions/18119270

문제

Is there a way to get Client IP Address (for auditing purpose) for existing update, insert queries without adding it as a parameter.

Scenario: I have a ASP.Net application hosted over intranet and using Subsonic for executing queries. Now the application has gone very big with too many insert, update, delete statements. Now there is a requirement for Audit logs to be maintained. For this purpose I have added triggers on my tables for insert, update and delete queries and my Audit table gets updated accordingly except with IPAddress / Client Identity who have made the request. Now, I can't afford to add one extra parameter to each of these statements.

Is there any provision in SQL or ASP.Net so that I can store IP Address or Host Name with minimum efforts and changes in my existing code.

Seen SUSER_NAME, HOST_NAME but I think it will give me my Server IP Address where application is hosted.

Sorry for my English.

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top