Skip to content

Instantly share code, notes, and snippets.

@alvin2ye
Created October 30, 2009 08:41
Show Gist options
  • Save alvin2ye/222225 to your computer and use it in GitHub Desktop.
Save alvin2ye/222225 to your computer and use it in GitHub Desktop.
USE MASTER
GO
SP_CONFIGURE 'ALLOW UpdateS',1 RECONFIGURE WITH OVERRIDE
GO
Update SYSDATABASES SET STATUS =32768 Where NAME='置疑的数据库名'
Go
sp_dboption '置疑的数据库名', 'single user', 'true'
Go
DBCC CHECKDB('置疑的数据库名')
Go
update sysdatabases set status =28 where name='置疑的数据库名'
Go
sp_configure 'allow updates', 0 reconfigure with override
Go
sp_dboption '置疑的数据库名', 'single user', 'false'
Go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment