Skip to content

Instantly share code, notes, and snippets.

@Tracnac
Created September 23, 2022 16:57
Show Gist options
  • Select an option

  • Save Tracnac/7f63a7bd681d0bcd7199f017292bc055 to your computer and use it in GitHub Desktop.

Select an option

Save Tracnac/7f63a7bd681d0bcd7199f017292bc055 to your computer and use it in GitHub Desktop.
MsSQL quick fix (Suspect) #mssql
EXEC sp_resetstatus [DB_with_suspect_mode];

alter database [DB_with_suspect_mode] SET partner off

ALTER DATABASE [DB_with_suspect_mode] SET EMERGENCY

DBCC checkdb ([DB_with_suspect_mode])

ALTER DATABASE [DB_with_suspect_mode] SET ONLINEEXEC sp_resetstatus [DB_with_suspect_mode];

alter database [DB_with_suspect_mode] SET partner off

ALTER DATABASE [DB_with_suspect_mode] SET EMERGENCY

DBCC checkdb ([DB_with_suspect_mode])

ALTER DATABASE [DB_with_suspect_mode] SET ONLINE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment