Frage

We are just creating a simple utility for our users to fire off a trace on their SQL Server Database. The App just takes their server connection details and they click start trace. Under the hood it fire the following profiler command line:

profiler /S MY-LAPTOP /U sa /P Admin123  /T "Tracer2008" /O "C:\Trace.trc" /M "05-16-14 10:15:46" /Z 20

This works fine in there is already a Profiler template imported into the profiler called Tracer2008.

I've got the Tracer2008.tdf file exported. Just wanting to know how we can go about importing the template via command line or in some manor so that it already in the system before we fire off the profiler call?

War es hilfreich?

Lösung

You can add a step that copies the template from some shared location into the expected local folder. Check the SQL Profiler Templates Missing - additional repair steps? for details.

The local folder depends on both the profiler's version as well as the version of the server you are connecting to.

For example, the SQL Server 2012 version of the profiler connecting to the SQL Server 2012 uses the following folder for templates:

C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Profiler\Templates\Microsoft SQL Server\110

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top