Hi All,

I used the following code to re-build indexes in SQL Server 2000 and it worked fine:

EXECUTE master.dbo.xp_sqlmaint N'-D DBName -Rpt "T:\MaintPlanRpts\Optimization For DBName.txt" -DelTxtRpt 2DAYS -WriteHistory -RebldIdx 10 -RmUnusedSpace 50 10 '

Backup Log DBName with truncate_only

dbcc shrinkfile (DBName_log, 150)


Now in SQL Server 2005 I use database mirroring for the disaster recovery so I can't use the above code. With the new code I am looking for the same results.

How can I accomplish this?

Thanks.