During use of the database, due to power failure or other reasons, it is possible to cause some small errors in the database. For example, some tables are particularly slow, and the query is less than qualified data.
The reason for these conditions is often because the database is somewhat damage, or the index is incomplete.
In Access, there is a feature that fixes the database to solve this problem. In SQL Enterprise Manager, there is no such feature, you want to use the statement to complete, how to complete the database with the SQL statement, you need to pay attention, When the following operation, all users must be disconnected:
Use mastergo
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