Created
April 27, 2017 15:20
-
-
Save xanthalas/8123ddebeb6c9b0e81fb09abd7f3a95b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Used this after McAfee decided my hard drive was "removable" and set it to read-only as per the company group policy */ | |
| /* Making it read-only made all the databases unavailable but once it was writeable again the code below fixed them */ | |
| ALTER DATABASE [my_database_name] SET SINGLE_USER WITH NO_WAIT | |
| ALTER DATABASE [my_database_name] SET EMERGENCY | |
| DBCC checkdb ([my_database_name], REPAIR_ALLOW_DATA_LOSS) | |
| ALTER DATABASE [my_database_name] SET ONLINE | |
| ALTER DATABASE [my_database_name] SET MULTI_USER WITH NO_WAIT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment