Executing CHECKDB on all user databases via TSQL

Run below Query. And once the query executes completely, go through the SQL Server Error log to see the results.

Read and filter SQL server error logs using TSQL

Command:

Parameter 1: To specify the errorlog number. Starts from 0. 0 = current, 1 = Archive #1, 2 = Archive #2

Parameter 2: Log file type. 1 or NULL for Error log and 2 for SQL Agent Log

Parameter 3: Search string

Parameter 4: Second search string further refine your search. Continue reading “Read and filter SQL server error logs using TSQL”