I am writing a scheduled job to mimic a SQL Server maintenance plan for SQL Express. (I have to do this because SQL Agent and related tools don't exist for SQL Express)
One of the steps is to do a database integrity check. The TSQL for this is:
DBCC CHECKDB(N'Northwind') WITH NO_INFOMSGS
How do I know if an error occurred during execution of this command, will it throw an Exception when using ADO.NET or would I have to parse the text output of the command (if so what do I look for in the output)
This is difficult to test because I don't have a corrupt database on hand.