I wast trying to connect a MSSQL Database and found it’s not connecting. I used Management studio and found database is showing in suspect mode. I found some some of queries that an be combined and used to recover database from suspect mode. here it is..
Why my database in suspect mode..
- Database file compressed
- Database file corrupted
- Insufficient memory for the Database.
Note: Backup the database files before do anything.
-- ALTER DATABASE [Database Name] SET EMERGENCY -- DBCC CHECKDB('[Database Name]'); -- ALTER DATABASE <Database Name> SET SINGLE_USER WITH ROLLBACK IMMEDIATE; -- DBCC CheckDB ([Database Name] , REPAIR_ALLOW_DATA_LOSS) -- ALTER DATABASE dbName SET MULTI_USER
Note: There might be chances that some of your recent data get lost.