• river, the way i read the NO_INFOMSG parameter is no results at all...seems ideal for an unattended job, but if you want results, i think you need to to just run dbcc checkdb and then filter the results; for example, one of the messages i just got on a table was this:

    ...

    DBCC results for 'GMCDBGACCOMP_OLD'.

    Msg 2508, Level 16, State 3, Line 2

    The In-row data RSVD page count for object "GMCDBGACCOMP_OLD", index ID 1, partition ID 377040118808576, alloc unit ID 377040118808576 (type In-row data) is incorrect. Run DBCC UPDATEUSAGE.

    There are 0 rows in 0 pages for object "GMCDBGACCOMP_OLD".

    CHECKDB found 0 allocation errors and 1 consistency errors in table 'GMCDBGACCOMP_OLD' (object ID 1458208345).

    ...

    CHECKDB found 0 allocation errors and 1 consistency errors in database 'AZ_900_TEST'.

    DBCC execution completed. If DBCC printed error messages, contact your system administrator.

    so if you searched the results for something that was NOT like '%0 allocation errors%' or NOT like

    '%0 consistency errors%' , you'd knwo there was a problem,a nd can drill down for the error messages themselves.

    http://msdn.microsoft.com/en-us/library/ms176064.aspx

    river1 (7/6/2010)


    Do you say that the DBCC command does not return any results? even if there is a problem with the DB?

    What i want is that, if there is a problem with the DB, then the results should be returned but if there are no errors, then no results need to be returned (the file can be created even empty, no prob.)

    So if i do DBCC with no_infosmsg will the SQL Server return results if the dabase as an error, or not?

    Thank you

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!