Have you ever encountered the frustrating SQL Profiler error message that says “Cannot retrieve trace definition for SQL Server version X.X.XXX”? If so, you’re not alone. This error message can be quite confusing and leave you scratching your head. But fear not, we’re here to help you fix this issue.
When I encountered this error message, I was initially puzzled by the lack of any actual error message. It simply displayed a blank message box. However, upon further investigation, I discovered that the version number shown in the message (in my case, 13.0.900) corresponds to the version of my SQL Server instance (SQL Server 2016 CTP) that I was trying to connect to.
So, how do we fix this error? The solution lies in copying the trace definition files from a working machine to the one experiencing the issue. Here are the steps to follow:
- Make a complete backup of the following location on your client machine:
C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Profiler\TraceDefinitions - From a working machine that has been tested and verified to work properly, navigate to the same location mentioned above.
- Create a copy of the
TraceDefinitionsdirectory on the working machine. - Replace the
TraceDefinitionsdirectory on your client machine with the copy from the working machine.
It’s important to note that the numeric value in the path corresponds to the SQL Server release version. Here’s a handy table to help you find the correct numeric value:
| SQL Server Release | Numeric Value |
|---|---|
| SQL Server 2000 | 80 |
| SQL Server 2005 | 90 |
| SQL Server 2008 | 100 |
| SQL Server 2008 R2 | 100 |
| SQL Server 2012 | 110 |
| SQL Server 2014 | 120 |
| SQL Server 2016 | 130 |
Once you have copied the trace definition files from the working machine to your client machine, you should be able to open SQL Profiler without encountering the “Cannot retrieve trace definition” error.
Remember to always make a backup of the original files before replacing them, just in case anything goes wrong. With these steps, you can quickly and easily fix this frustrating SQL Profiler error and get back to analyzing your SQL Server performance.