USE MASTER GO SP_CONFIGURE 'ALLOW UPDATES',1 RECONFIGURE WITH OVERRIDE GO ALTER DATABASE Database_Name SET EMERGENCY GO sp_dboption 'Database_Name', 'single user', 'true' GO DBCC CHECKDB('Database_Name','REPAIR_ALLOW_DATA_LOSS') GO ALTER DATABASE Database_Name SET ONLINE GO sp_configure 'allow updates', 0 reconfigure with override GO sp_dboption 'Database_Name', 'single user', 'false' GO