dbcc messages  
Author Message
anonymoususer





PostPosted: Wed Oct 04 21:10:36 CDT 2006 Top

SQL Server Developer >> dbcc messages

If I run EXEC sp_MSforeachtable 'DBCC DBREINDEX ("?")' in QA I get messages
indicating the results of each table that's reindexed. If I run the same
code from an exe how can I get at those messages to either log them in a
text file or display them to the user?

Thanks,

Keith

SQL Server65  
 
 
Hari





PostPosted: Wed Oct 04 21:10:36 CDT 2006 Top

SQL Server Developer >> dbcc messages Hi,

Use OSQL or SQLCMD inside your EXE to call the DBCC command and redirect the
output to a Log file using -o<logfilename>

Thanks
Hari




> If I run EXEC sp_MSforeachtable 'DBCC DBREINDEX ("?")' in QA I get
> messages
> indicating the results of each table that's reindexed. If I run the same
> code from an exe how can I get at those messages to either log them in a
> text file or display them to the user?
>
> Thanks,
>
> Keith
>
>
>