DBCC CHECKDB,REPAIR_REBUILD,REPAIR_ALLOW_DATA_LOSS
The below piece of code is providing your the DBCC CHECKDB commands.
USE master GO ALTER DATABASE AdventureWorksDW2017 SET SINGLE_USER WITH ROLLBACK IMMEDIATE DBCC CHECKDB('AdventureWorksDW2017',REPAIR_REBUILD) ALTER DATABASE AdventureWorksDW2017 SET MULTI_USER ---------------------------------------------------------------- USE master GO ALTER DATABASE AdventureWorksDW2017 SET SINGLE_USER WITH ROLLBACK IMMEDIATE DBCC CHECKDB('AdventureWorksDW2017',REPAIR_ALLOW_DATA_LOSS) ALTER DATABASE AdventureWorksDW2017 SET MULTI_USER
Comments