August 12, 2003 at 11:40 pm
Hi mpeters,
quote:
I can handle the attach/detach through SQLDMO objects, but how do I run a DBCC and get a simple Success/Fail result? Someone has suggested running the DBCC check via the SQLMAINT.EXE util - would this be a viable option?
yes, it is a viable option.
If you don't want to deal with the command line, you can use xp_sqlmaint as explained in BOL.
Cheers,
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
August 13, 2003 at 12:15 am
"C:\Program Files\Microsoft SQL Server\MSSQL\Binn\sqlmaint" -S lene -D Northwind -CkDB -CkCat -Rpt C:\Northwind.rpt
if errorlevel 1 echo ERROR
if errorlevel 0 echo OK
"C:\Program Files\Microsoft SQL Server\MSSQL\Binn\sqlmaint" -S lene -D MSDB -CkDB -CkCat -Rpt C:\MSDB.rpt
if errorlevel 1 echo ERROR
if errorlevel 0 echo OK
It worked!![]()
Viewing 2 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply