Why This Error Happens
Error 567 occurs when SQL Server’s trace-reading mechanism (fntracegettable, sptrace* functions, or SQL Server Profiler) attempts to parse a .trc file that does not conform to the internal Trace File binary format. This typically happens because the file has been truncated, corrupted during a file copy/transfer, renamed from a non-trace file extension, or was generated by an incompatible version of SQL Server that uses a different internal trace header structure. It can also occur if antivirus or backup software locked/modified the file mid-write, leaving an incomplete header.
Step-by-Step Resolution Guide
Step 1: Validate the File Path and Integrity
- Confirm the exact path referenced in the error message (e.g.,
C:\SQLTraces\trace_log.trc) actually exists and is not zero bytes. - Run
dir /s /b *.trcfrom Command Prompt in the target directory to confirm the file extension and size. - Check file properties for a valid binary header — a healthy
.trcfile should never be openable as plain readable text; if it opens as garbled text or is empty, it is corrupted.
Step 2: Re-acquire the Trace File from a Clean Source
- If the file was copied over a network share or via FTP, re-copy it using binary transfer mode (not ASCII/text mode), since text-mode transfers strip or alter byte sequences and break the trace header.
- On Windows Server 2025 / Windows 11, use Robocopy instead of standard copy to preserve exact byte streams:
robocopy "\\source\share\Traces" "C:\SQLTraces" trace_log.trc /J
- If the original trace was generated by SQL Server 2025 Extended Events instead of legacy SQL Trace, ensure you are not mistakenly trying to load an
.xelfile usingfn_trace_gettable.
Step 3: Verify Trace Compatibility and Regenerate if Needed
- SQL Server 2025 deprecates classic SQL Trace/Profiler in favor of Extended Events (XEvents); confirm the
.trcfile was not generated by an older SQL Server version incompatible with the new engine parser. - If the source trace is unrecoverable, regenerate a fresh trace using Extended Events:
CREATE EVENT SESSION [DiagTrace] ON SERVER
ADD EVENT sqlserver.sql_statement_completed
ADD TARGET package0.event_file(SET filename=N'C:\SQLTraces\DiagTrace.xel');
ALTER EVENT SESSION [DiagTrace] ON SERVER STATE = START;
- Convert legacy
.trcfiles (if truly needed) using SQL Server Management Studio’s Import Trace Wizard rather than direct T-SQL functions.
Step 4: Check File Permissions and Locking Processes
- Ensure the SQL Server service account has Read/Write NTFS permissions on the trace directory (
Right-click folder > Properties > Security). - Use Resource Monitor or
handle.exe(Sysinternals) to confirm no other process (antivirus, backup agent) holds an exclusive lock on the.trcfile while SQL Server attempts to read it. - Temporarily exclude the trace folder from real-time antivirus scanning to rule out interference during file writes.
Alternative or Verification Steps
- Verify the fix by running
SELECT * FROM fn_trace_gettable('C:\SQLTraces\trace_log.trc', DEFAULT);and confirming it returns rows without Error 567. - If the file remains unreadable, abandon the legacy trace approach entirely and migrate diagnostic capture to Extended Events sessions, which are natively supported and fully validated in SQL Server 2025.