Search code examples
sql-server-2008dbcc

SQL Server DBCC not displaying output


I am trying to use DBCC to see page information on a table. When I run

DBCC page (master, 1, 1, 0)
GO

I get

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

in SSMS's Messages window.

I do not see output of DBCC. Do I have to pass some flag?


Solution

  • The default output is to the errorlog. You need to enable trace flag 3604 as described in this MSDN blog post to redirect the output.

    DBCC TRACEON (3604) -- turns on flag 3604 for your session
    DBCC PAGE (master, 1, 1, 0);
    DBCC TRACEOFF(3604) -- turns off 3604 for your session
    
    DBCC TRACEON (3604, -1) -- turns on flag 3604 globally
    DBCC PAGE (master, 1, 1, 0);
    DBCC TRACEOFF(3604, –1) -- turns off 3604 globally