fn_trace_gettable error if rollover trace file is empty

  • Select *

    FROM ::

    FN_TRACE_GETTABLE('D:\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\log.trc', DEFAULT) AS fgt

    (the default trace)

    Here's the error I get:

    Msg 567, Level 16, State 2, Line 1

    File 'D:\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\log_2513.trc' either does not exist or is not a recognizable trace file. Or there was an error opening the file.

    the _2513 file is 0 KB

    Plenty of data in the other files.

    How can I bypass this?

  • Have you tried opening the same trace file using Sql server profiler?

  • The file is empty. Opening it up in Profiler reminds me of this. Opening a prior one in profiler then telling it to get the next (blank) one it doesn't conplain.

  • Bumping in case anyone who might have a solution missed it when it was posted...

  • Pam just to be sure the path tot eh file is correct, does this work for you?

    i think it works, but does it do what you were looking for?

    --get teh path from the database.

    declare @path varchar(500)

    SELECT @path = path FROM sys.traces WHERE is_default = 1

    Select *

    FROM ::

    FN_TRACE_GETTABLE(@path, DEFAULT) AS fgt

    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!

  • The path is fine. It finds everything just fine. The only issue is that the one rollover file is blank.

  • Another reason I found for this error was spaces in the filename or path

    sys.fn_trace_gettable('C:\Documents and Settings\tbrown\My Documents\share\Trace20120403 1200.trc', null)

    caused the error, whereas the same trace file renamed

    sys.fn_trace_gettable('C:\temp\Trace20120403_1200.trc', null)

    worked fine. This was in 2008, so I guess the same bug is in 2005

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply