is there a query to list database user access and related source IPs on SQL Server 2000 and 2005? Please note that reporting service is not installed.

Thank you all for help.

link|improve this question

feedback

2 Answers

sp_who or sp_who2 should give you what you need. They won't list the ip address but they will list the hostname. sp_who2 will give you more information than sp_who.

link|improve this answer
Thank you for your answer. sp_who and sp_who2 only shows current sessions, I need also past ones, such a 'logon history' – Danilo Brambilla May 7 '10 at 7:53
feedback
up vote 0 down vote accepted

I found this query that seems to list user access but it doesn't record source IP. Please note path has to be verified before runnning the query:

SELECT TargetLoginName, SessionLoginName, HostName, StartTime
FROM fn_trace_gettable('X:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\log_59.trc', default);
GO
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.