This section explains only dbcc checkalloc with the fix option. Refer to “dbcc” in the Reference Manual for information about dbcc and its other keywords and options.
dbcc checkalloc with the fix option detects and fixes allocation errors in databases.
dbcc checkalloc(database_name, fix)
1> sp_dboption database_name, single, true 2> go
1> use database database_name 2> go
1> checkpoint 2> go
1> dbcc checkalloc(database_name, fix) 2> go
1> use master 2> go
1> sp_dboption database_name, single, false 2> go
1> use database_name 2> go
1> checkpoint 2> go
Databases must be in single-user mode or dbcc checkalloc with the fix option will fail with error 2595.