Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can profiler templates be migrated to newer versions of SQL Profiler?

Is it possible to migrate Profiler templates to newer versions of SQL Server?

In my case I want to take my SQL 2008 templates to 2012. I've tried (1) a straight file copy and (2) an export/import. In both cases the older templates run, but cannot be modified. Modifications result in the following error:

Error message when editing upgraded template

I've got a bunch of custom templates and I'm trying to avoid recreating them by hand. Although, I guess that is the fallback position. Thoughts?

like image 966
EBarr Avatar asked Sep 21 '12 21:09

EBarr


People also ask

How do I import a template into SQL profiler?

On the File menu, click Templates, and then click Import Template. In the Open File dialog box, select the trace template file (. tdf file) to import and click Open. The trace template file is added to the available templates in the Use the template list in the Trace Properties dialog box.

Where are SQL profiler templates stored?

In order for everyone to be able to use these templates we need to copy them to the following folder, C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Profiler\Templates\Microsoft SQL Server\130 (note: Your path may differ depending on your installation and version of SQL Server).

What are the templates available on SQL Server profiler?

SQL Server Profiler offers predefined trace templates that allow you to easily configure the event classes that you will most likely need for specific traces. The Standard template, for example, helps you to create a generic trace for recording logins, logouts, batches completed, and connection information.

How do I export SQL profiler?

To export a trace template In the Select Template Name dialog box, select the template to export in the Select template namelist, and then click OK. The Save As dialog box appears.


2 Answers

Yes, I managed to move mine from 2012 to 2014.

Export from 2012. Import into 2014.

At this stage the new template will only run agains 2012 instances of SQL Server, and not your local 2014 one.

Ensuring profiler is closed, you need to go to explorer and copy the file from the folder representing 2012 templates to the 2014 one:

C:\Users\YOURUSERNAME\AppData\Roaming\Microsoft\SQL Profiler\12.0\Templates\Microsoft SQL Server\120

like image 101
James_UK_DEV Avatar answered Sep 28 '22 01:09

James_UK_DEV


Export the template from SQL Server 2008's version of Profiler (I assume you have already done that).

Now open 2012 Profiler, go to File > Templates > Import and choose your .tdf file.

You will have a new user trace template with the name [filename] (without the .tdf). Go to File > Templates > Edit and pick the trace template you imported. You should then be able to edit the server type by pulling the dropdown : enter image description here

Then you can save the template and that should be the server type when you start a new trace using that template. When you pick the different server type, the template name disappears, but if you save it does edit the selected template.

Note: this all taken from a previous question on dba.stackexchange.com.

like image 30
Aaron Bertrand Avatar answered Sep 28 '22 00:09

Aaron Bertrand