August 21, 2007 at 10:10 am
We have a stored procedure that stores the IP address from the calling program for auditing purposes. I have't found a function that supplies the IP address yet. Anybody have a solution for me?
August 21, 2007 at 11:09 am
do you mean using DNS/nslookup to convert an ipaddress like 66.94.234.13 to http://www.yahoo.com?
Lowell
August 21, 2007 at 12:29 pm
To do this you need permission to run xp_cmdshell from master database
Please follow the link below
http://www.sqlmag.com/Article/ArticleID/48303/sql_server_48303.html
Cheers
Asiff
August 21, 2007 at 12:42 pm
We are just starting out in SQL Server and would like to avoid using xp-cmdshell if we can because we aren't real sure of ourselves with securing it. Current circumstances won’t allow us to use Windows AD security, so that adds another wrench into it. What we are doing is capturing an audit trail. We are leaning to using the machine name instead of the IP address both for simplifying the logic and being a bit more definite of where the access was from.
August 21, 2007 at 2:03 pm
yeah having to roll thru the tables later after the IP's been captured woudl be a pain in the audit.
Since you are going to use HOST_NAME instead, you obviously are already aware of some of the system functions to get data like that...for others whoa re reading this, try something like this:
select CURRENT_USER,host_name(),HOST_ID(),SYSTEM_USER
you'll get results like this:
dbo | DAISY | 1788 | sa |
that info can be captured and used in a field in your audit tables if needed.
Lowell
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply