Created
July 8, 2022 11:11
-
-
Save davidsheardown/82fb5d6dc095900084057a210e950771 to your computer and use it in GitHub Desktop.
Revisions
-
davidsheardown created this gist
Jul 8, 2022 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ SELECT DATABASEPROPERTYEX (N'SQL-Examples', N'STATUS') AS N'Status'; ALTER DATABASE [SQL-Examples] SET EMERGENCY; GO ALTER DATABASE [SQL-Examples] SET SINGLE_USER; GO DBCC CHECKDB (N'SQL-Examples', REPAIR_ALLOW_DATA_LOSS) WITH NO_INFOMSGS, ALL_ERRORMSGS; GO -- Remember to set back to multi-user ALTER DATABASE [SQL-Examples] SET MULTI_USER; GO