Using SQLMAINT.EXE for Database Maintenance

The SQLMAINT utility is used to perform database maintenance activities from the command line. Database backups and certain DBCC statements can be specified to run. The Database Maintenance Plan Wizard actually uses a subset of SQLMAINT options, calling them through the xp_sqlmaint extended-stored procedure.

Why would you want to run T-SQL statements from the command line when SQL Server has its own built-in job and scheduling functions? One advantage of SQLMAINT is its ability to generate a report of its activities and save it to a text or HTML file, or e-mail it to an operator. SQLMAINT can also group several operations into one statement; if this statement is saved as a script, it could then be copied ...

Get Microsoft® SQL Server™ 2000 Unleashed, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.