Monday, March 12, 2012

Login Audit

I'd like to keep track of the number of logins to a SQL server over a
day which are then logged in a simple text file, for licensing
reasons. What do you think is the best way to do this? I was thinking
of using a trace but fear this may generate too much info. Could I
schedule a stored procedure to run every hour which records the number
and exports to a text file?
Thanks for your help in advance!
JohnTurn of the Login success and failure auditing functionality of SQL Server.
This will create an entry for each event in the NT Application Eventlog,
then you use WMI to filter them out and send them to a file for example.
This will be the lowest overhead solution, using SQL Trace/Profiler has much
more impact on your server performance.
GertD@.SQLDev.Net
Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.
Copyright SQLDev.Net 1991-2004 All rights reserved.
"John McGinty" <jpmcginty@.talk21.com> wrote in message
news:87642ea9.0401280404.40536dde@.posting.google.com...
quote:

> I'd like to keep track of the number of logins to a SQL server over a
> day which are then logged in a simple text file, for licensing
> reasons. What do you think is the best way to do this? I was thinking
> of using a trace but fear this may generate too much info. Could I
> schedule a stored procedure to run every hour which records the number
> and exports to a text file?
> Thanks for your help in advance!
> John
|||The logins also get sent to the SQL Server errorlog as well.
Rand
This posting is provided "as is" with no warranties and confers no rights.

No comments:

Post a Comment