Thursday, October 31, 2024

็How to repair table script sql by dbcc checktable

 USE KMx10

GO

ALTER DATABASE KMx10 SET SINGLE_USER WITH ROLLBACK IMMEDIATE;

GO

DBCC CHECKTABLE (N'job',REPAIR_REBUILD) WITH NO_INFOMSGS, ALL_ERRORMSGS;

GO

ALTER DATABASE KMx10 SET MULTI_USER;

How to fixe database in restoring mode

  RESTORE DATABASE YourDatabaseName WITH RECOVERY;