Hello,
We know it is unavoidable that SQL Server database may be damaged, suspect or unavailable for some reasons such as power off unexpectedly, harddisk failure etc.
If this happens, we can choose to execute 'DBCC CheckDB' or restore from the backup. basically this has to be done by manual with 2 steps:
1, the user find that the database is not OK;
2, the user try to find a way to fix it.
Now I try to develop a software application to do these because it is a unattended product.
My question is:
Is there any way that SQL Server can let the visiting software know that the target database is damaged, suspect or unavailable? does SQL Server return specific error code for this?
Thanks!