Skip to content

Instantly share code, notes, and snippets.

@indrapermana
Created November 4, 2019 04:49
Show Gist options
  • Save indrapermana/f49077a38de25d849a00bac9195261b4 to your computer and use it in GitHub Desktop.
Save indrapermana/f49077a38de25d849a00bac9195261b4 to your computer and use it in GitHub Desktop.
sql server fix recovery pending
ALTER DATABASE [DB_NAME] SET EMERGENCY;
GO
ALTER DATABASE [DB_NAME] set single_user;
GO
DBCC CHECKDB ([DB_NAME], REPAIR_ALLOW_DATA_LOSS) WITH ALL_ERRORMSGS;
GO
ALTER DATABASE [DB_NAME] set multi_user;
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment