Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 How to get not error DBCC message into the variable

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-02-08 : 15:46:45
Irina writes "I need to check the database at night and if any problem founded, repair it and make the report about it. Also they want to repair indexes if they are corrupted but it is Ok to just repair all indexes. The features (e-mail,logfile) provided from wizard when you create jobs, tasks or maintenance plan is not good because they want to have the e-mail with the report about what happened in the database and have the same report in the specified subdirectory.

I am create the stored procedure which can be runes in Task Scheduler for SQL 6.5 and Job Scheduler for SQL 7.0. The procedure run DBCC dbchecktable, dbreindex and updateusage for each user-defined table in the database. but the problem to retrieve messages returned by each DBCC command( not error messages) in to variable so I can insert them into temporary table and then send all report via e-mail and text file. Also I don't know haw to create the text file from the stored procedure.

The questions:
1. How to get not error DBCC message into the variable?
2. How to create text file from stored procedure and pull data into it?"
   

- Advertisement -