In the process of using the database, due to power outages or other reasons, there may be some small errors in the database, such as the retrieval of some tables is particularly slow, the query does not meet the conditions of the data.
These situations occur because the database is somewhat corrupted or the index is incomplete.
In Access, there is a fix the database function can solve this problem, in SQL Enterprise Manager, do not have this function, to use the statement to complete, the following describes how to complete the database with SQL statement repair, you need to note that in the following operation, you must disconnect all users:
Use MASTER
Go
sp_dboption ' Your database name ', ' Single user ', ' true '
Go
DBCC CHECKDB (' Your database name ', Repair_rebuild)
Go
Use your database name
Go
exec sp_msforeachtable ' DBCC checktable ('? ', Repair_rebuild) '
Go
sp_dboption ' Your database name ', ' Single user ', ' false '
Go