> osql -S <SERVER>/<INSTANCE> -E
> DBCC CHECKDB('<db_name>') WITH NO_INFOMSGS
if it doesn't return a message it means that the database is ok
Otherwise it will return one of the two following repair level:
- REPAIR_ALLOW_DATA_LOSS
- REPAIR_REBUILD
> exec sp_dboption '<db_name>','single user','<true>';
> DBCC CHECKDB('<db_name>','<repair_level>')
> exec sp_dboption '<db_name>','single user','<false>';