-- sql server 2008 USE MASTER GO SP_CONFIGURE ‘ALLOW UPDATES‘,1 RECONFIGURE WITH OVERRIDE GO ALTER DATABASE MixiguoBizDB SET EMERGENCY GO sp_dboption ‘MixiguoBizDB‘, ‘single user‘, ‘true‘ GO DBCC CHECKDB(‘MixiguoBizDB‘,‘REPAIR_ALLOW_DATA_LOSS‘) GO ALTER DATABASE MixiguoBizDB SET ONLINE GO sp_configure ‘allow updates‘, 0 reconfigure with override GO sp_dboption ‘MixiguoBizDB‘, ‘single user‘, ‘false‘ GO
-- sql server 2012 USE MASTER GO SP_CONFIGURE ‘ALLOW UPDATES‘,1 RECONFIGURE WITH OVERRIDE GO ALTER DATABASE Tfs_DefaultCollection SET EMERGENCY GO alter database Tfs_DefaultCollection set SINGLE_USER with ROLLBACK IMMEDIATE --sp_dboption ‘Tfs_DefaultCollection‘, ‘single user‘, ‘true‘ GO DBCC CHECKDB(‘Tfs_DefaultCollection‘,‘REPAIR_ALLOW_DATA_LOSS‘) GO ALTER DATABASE Tfs_DefaultCollection SET ONLINE GO sp_configure ‘allow updates‘, 0 reconfigure with override GO --sp_dboption ‘Tfs_DefaultCollection‘, ‘single user‘, ‘false‘ alter database Tfs_DefaultCollection set MULTI_USER with ROLLBACK IMMEDIATE GO