SQL Server administration tip: check your database’s consistency
Posted: (EET/GMT+2)
If you are developing smaller applications that utilize an SQL Server database, chances are the you need to take part or at least give advice to your customers on how to administer and maintain the database.
SQL Server is a dependable database, and for the most time, you don't need to maintain your database much. However, from time to time, problems might surface, and if this happens, your customer might contact you about what to do next.
Today's tip is an SQL Server command to check database consistency. This can be done with the command DBCC CHECKDB. This command "checks the logical and physical integrity of all the objects in the specified database" and gives you a simple report of its findings.
Running this command periodically, say once every quarter, to check if everything is still okay. At best, this command can give you hints that something might go wrong in the future.