Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dario61081
Created May 31, 2021 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dario61081/a7a1c77013f0444ad7eb9b2481909447 to your computer and use it in GitHub Desktop.
Save dario61081/a7a1c77013f0444ad7eb9b2481909447 to your computer and use it in GitHub Desktop.
mssql: Recovery database in suspect mode
USE master
GO
ALTER DATABASE milleniumfox SET EMERGENCY
GO
DBCC CHECKDB (milleniumfox )
GO
ALTER DATABASE milleniumfox SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
DBCC CHECKDB (milleniumfox, REPAIR_ALLOW_DATA_LOSS)
GO
ALTER DATABASE milleniumfox SET MULTI_USER
GO
@dario61081
Copy link
Author

Script to recover ddbb in suspect mode, execute in a new query with the ddbb in offline mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment