Deletes the results of dbcc checkstorage operations performed on the target database before the specified date and time.
sp_dbcc_deletehistory [cutoffdate [, dbname | dbid]]
deletes all entries made on or before this date. This parameter is of type datetime. If a date is not specified, only the results of the last operation are retained. For more information, see “Specifying the date”.
specifies the name of the database for which the data must be deleted. If not specified, sp_dbcc_deletehistory deletes the history information for all databases in dbccdb..dbcc_config.
specifies the database ID number of the target database for which you want the history information deleted.
Deletes results of all operations performed on the database pubs2 on or before March 4, 1997:
sp_dbcc_deletehistory "03/04/1997", "pubs2"
sp_dbcc_deletehistory deletes the results of dbcc checkstorage operations performed on the target database before the specified date and time.
If the target database is dbccdb, and the dbccalt database exists, sp_dbcc_deletehistory deletes historical data for dbccdb from dbccalt.
The value specified for cutoffdate is compared to the finish time of each dbcc operation.
Use the dbid option to delete the historical data of the dbccdb database for a database that has already been dropped.
Using the dbid option is the only way to delete the historical data of the dbccdb database for a database that has already been dropped.
To see the dates when dbcc checkstorage was run so that you can choose the value for cutoffdate, run sp_dbcc_summaryreport.
Only a System Administrator or the Database Owner can run sp_dbcc_deletehistory on a specific database.
Only a System Administrator can run sp_dbcc_deletehistory without specifying a database name.
See the System Administration Guide for information on the dbccalt database.
Commands dbcc
dbcc stored procedures sp_dbcc_deletedb, sp_dbcc_evaluatedb
System procedures sp_plan_dbccdb
Copyright © 2005. Sybase Inc. All rights reserved. |