Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Output filename as a variable in the Profiler script file. How?

Status
Not open for further replies.

Nakis

MIS
Jun 5, 2002
37
0
0
CY
I wanted to schedule profiler to run at a specific time and produce a trace file. I have scripted the Profiler and use osql to do that from command line using windows scheduler.
My problem is that every day, I want to give a different name to my trace file.
Here's the line in concern in the .sql Profiler script file:

exec @rc = sp_trace_create @TraceID output, 0, N'D:\TBD\Treasury_EOD', @maxfilesize, @Datetime

Any ideas will be welcomed.


Thank you all in advance
 
Not sure if this will work but give it at try

declare @filename nvarchar(50)
select @filename ='D:\TBD\Treasury_EOD' + convert(varchar,getdate(),110)

exec @rc = sp_trace_create @TraceID output, 0, @filename , @maxfilesize, @Datetime



Denis The SQL Menace
SQL blog:
Personal Blog:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top