Avatar of rborda
rborda
Flag for United States of America asked on

How to obtain some fields out of the security log created by SQL Server

Thank you in advance for any input,

I need two get only the user and the date out of the "security log" that shows user's logon/logoff data.
This log is found under Management\SQL Server Logs\Current... then there are several Archives.
The following two selects does not provide me with the same information that the log contains:

select * from sys.server_principals
select * from sys.database_principals
Microsoft SQL ServerMicrosoft SQL Server 2005

Avatar of undefined
Last Comment
Guy Hengel [angelIII / a3]

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Guy Hengel [angelIII / a3]

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Guy Hengel [angelIII / a3]

you might however want to check out this script:
http://www.databasejournal.com/img/sp_import_errorlog.sql

using this stored procedure:
EXEC sp_readerrorlog @log_number
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy