Forum Discussion
Rahul_Kumar1
11 years agoLevel 6
Hi,
Note: Make sure you stop the SQLSERVER( BKUPEXEC) service and take a copy of the DATA folder before performing this.
Also you need to manually serach for the table having millions of entries by going to properties of each table.
The following SQL script can be used to delete multiple rows of data from tables with excessive database to provide additional space for the BEDB.
- Open SQL Management Studio
- Check the properties of the tables in BEDB to see which table has millions of rows. Most common are "JobHistoryDetailInfo" and "Alerts"
- Right-click BEDB and select "New Query"
- Copy and paste the script below to delete 1 million rows
- "TABLENAME" in the scrip below should be replaced with the name of the table you want to delete rows from. Most common are "JobHistoryDetailInfo" and "Alerts"
- Do not delete more than 1 million rows at a time, SQL will hang (once the query completes, you can simply run it again to delete more rows)
- Starts deleting the oldest data first
Delete Top (200000) From TABLENAME
DBCC Shrinkdatabase (BEDB)
Delete Top (200000) From TABLENAME
DBCC Shrinkdatabase (BEDB)
Delete Top (200000) From TABLENAME
DBCC Shrinkdatabase (BEDB)
Delete Top (200000) From TABLENAME
DBCC Shrinkdatabase (BEDB)
Delete Top (200000) From TABLENAME
DBCC Shrinkdatabase (BEDB)
Related Content
- 13 years ago
- 7 years ago