Skip to content

Instantly share code, notes, and snippets.

@LetsGoRafting
Last active September 2, 2018 20:32
Show Gist options
  • Save LetsGoRafting/7ccad737d97b476e9d6f106f94227249 to your computer and use it in GitHub Desktop.
Save LetsGoRafting/7ccad737d97b476e9d6f106f94227249 to your computer and use it in GitHub Desktop.
-- Parameters:
-- int - log file number 0 is current, any other the nth file descending
-- int - 1 for SQL Server logs, 2 for Agent logs
-- string - search word 1
-- string - search word 2
-- date - from
-- date - to
-- desc - for descending, otherwise ascending as default
-- search server log for key word 'error'
xp_readerrorlog 0,1, 'Error', NULL, NULL, NULL,N'desc'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment