Summary article: Http://www.cnblogs.com/dunitian/p/4822808.html#tsql
Paste Error First:
Spit on the trough for a moment:
Go to the Chase:
Create a new database with the same name
Stop MSSQL Service
Replacing database files
Re-enable MSSQL service
See:
Setting up the database for emergency mode
ALTER DATABASE bigdata_testinfo SET emergency
Quick fix (if there is a problem please try, [repair_rebuild-rebuild Index and fix] and [repair_allow_data_loss-allow lost data repair method])
--DBCC CHECKDB usage (Manual Repair Database)--Check Database Integrity--dbcc checkdb (' database name ')--go--quick fix--dbcc checkdb (' database name ', repair_fast)-- go--rebuild the index and fix--dbcc checkdb (' database name ', repair_rebuild)--go--if necessary to allow loss of data repair--DBCC checkdb (' database name ', Repair_allow_data_loss)- -go
Restore to multi-user mode after successful repair ( turn off other query windows if an error occurs )
ALTER DATABASE Bigdata_testinfo set Multi_user
You refresh the database and you find out, okay ~
Scared to the point, quickly check the data there is no problem (formerly)
The size of the wood is also changed
Expand:
Someone attached to the time found ... Tips for rejecting xxx
Uh.. is actually not open permission:
Leave the current user's permission open and OK.
If you are a multi-user and you are afraid of trouble, set everyone's permissions
It's time to finish this.
Quick fix and set user back to multi-user mode
"SQL Server" "Recover pending Solution" prompt when attaching files "The log cannot be rebuilt because there is an open transaction/user when the database shuts down, the database does not have checkpoints, or the database is read-only. "Database Recovery"