Skip to content

Instantly share code, notes, and snippets.

@arman-hpp
Last active June 25, 2016 13:13
Show Gist options
  • Save arman-hpp/d00ee4e9a43a89f98afc7fd0cd09beb5 to your computer and use it in GitHub Desktop.
Save arman-hpp/d00ee4e9a43a89f98afc7fd0cd09beb5 to your computer and use it in GitHub Desktop.
SuspectDatabase
EXEC sp_resetstatus [YourDatabase];
ALTER DATABASE [YourDatabase] SET EMERGENCY
DBCC checkdb([YourDatabase])
ALTER DATABASE [YourDatabase] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB ([YourDatabase], REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE [YourDatabase] SET MULTI_USER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment