June 2, 2009

Logparser SQL Server 2005 Log

Logparser is one of my favorite tools. Here is a simple query that will parse a sql server 2005 log:


SELECT TOP 25 extract_token(field1,0,' ') as Date, extract_token(field1,1,' ') as Time, extract_token(field1,2,' ') as Source, field2 as Message
FROM c:\sql.log
ORDER BY Date, Time DESC

No comments:

Post a Comment