When trying to update a table in SQL Server, you may receive an error message, such as:
Msg: 211, Level 23, State 51, Line 1 Possible schema corruption.
Run DBCC CHECKCATALOG
Msg 0, Level 20, State 0, Line 0
This error is usually related to a problem with the schema or corruption in schema. The schema is generally a collection of objects in SQL Server, such as tables, related columns, its entries, and other items.
Such an issue may occur due to:
- Problem with software or a software failure.
- Problem with hardware or failure of hardware, like disk failure.
How to Resolve the Issue?
Follow the below solutions to resolve the issue.
Restore from Backup
If you have a backup, the best solution is to restore your data from the backup.
- To backup your database, in SSMS, go to the Object Explorer and right-click the database and select Tasks > Back Up.
- Select the Destination and the Backup Type, and then press OK.

If you need to back up the database using the T-SQL, use the following command:
BACKUP DATABASE [stellar] TO DISK = N’C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER03\MSSQL\Backup\stellar_LogBackup_2023-01-19_16-58-07.bak’ WITH NOFORMAT, NOINIT, NAME = N’stellar-Full Database Backup’
GO
- To restore the database, open the SSMS.
- Go to the Object Explorer, right-click the database, and select the Restore Database option from the context menu.
- In the Database combo box, select the database that you want to restore. Select the Backup sets to restore.
Alternatively, you can run the following T-SQL command to restore the database:
USE [master]
BACKUP LOG [stellar] TO DISK = N’C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER03\MSSQL\Backup\stellar_LogBackup_2023-01-19_18-19-32.bak’ WITH NOFORMAT, NOINIT, NAME = N’stellar_LogBackup_2023-01-19_18-19-32′, NOSKIP, NOREWIND, NOUNLOAD, NORECOVERY , STATS = 5
RESTORE DATABASE [stellar] FROM DISK = N’C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER03\MSSQL\Backup\stellar.bak’ WITH FILE = 1, NORECOVERY, NOUNLOAD, STATS = 5
RESTORE LOG [stellar] FROM DISK = N’C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER03\MSSQL\Backup\stellar_LogBackup_2023-01-19_13-00-38.bak’ WITH FILE = 1, NORECOVERY, NOUNLOAD, STATS = 5
RESTORE LOG [stellar] FROM DISK = N’C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER03\MSSQL\Backup\stellar_LogBackup_2023-01-19_16-58-07.bak’ WITH FILE = 1, NOUNLOAD, STATS = 5
GO
Run DBCC CHECKCATALOG Command
You can also run the DBCC CHECKCATALOG command to fix the issue. This command is used to verify the catalog consistency. To run this command, the database must be in single-user mode.
Here’s the command:
DBCC CHECKCATALOG (databasename)
The following example shows how to run the CHECKCATALOG command without displaying information messages.
DBCC CHECKCATALOG(stellar) WITH NO_INFOMSGS
However, in our case, we want to see the error message.
- To repair the database, run the DBCC CHECKDB command.
USE master;
GO
ALTER DATABASE stellar
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE;
GO
DBCC CHECKDB(‘stellar’,REPAIR_REBUILD)
GO
ALTER DATABASE stellar
SET MULTI_USER;
GO
- After repairing the database, set the database to multi-user mode.
- You can also use SSMS to set the database in single-user mode or multiple-user mode.
- In the Object Explorer, right-click the database and go to Properties.
- Go to the Options page and change the Restrict Access according to your needs.
Use a Third-party SQL Repair Software
Another solution is to use a third-party SQL database repair software, such as Stellar Repair for MS SQL. This software basically repairs the database file. The data files are files with the MDF extension. You need to set the database offline and then repair it using this software.
Conclusion
In this article, we’ve discussed the solutions to fix the SQL Server error 211. You can recover the database from the backup. You can run the DBCC CHECKCATALOG command or repair the database using the CHECKDB command. If everything fails, use Stellar Repair for MS SQL to repair the database and recover all its objects.
Was this article helpful?