Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. /* Used this after McAfee decided my hard drive was "removable" and set it to read-only as per the company group policy */
  2. /* Making it read-only made all the databases unavailable but once it was writeable again the code below fixed them */
  3.  
  4. ALTER DATABASE [my_database_name] SET SINGLE_USER WITH NO_WAIT
  5. ALTER DATABASE [my_database_name] SET EMERGENCY
  6. DBCC checkdb ([my_database_name], REPAIR_ALLOW_DATA_LOSS)
  7. ALTER DATABASE [my_database_name] SET ONLINE
  8. ALTER DATABASE [my_database_name] SET MULTI_USER WITH NO_WAIT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement