How to schedule the SQL Profiler trace

  • Hi,

    I want schedule to run sql server profiler in sql server 2005. But I did not find any option. I want schedule to run the profiler from 8:00AM to 6:00 PM. How can I do that

  • rambilla4 (6/17/2009)


    Hi,

    I want schedule to run sql server profiler in sql server 2005. But I did not find any option. I want schedule to run the profiler from 8:00AM to 6:00 PM. How can I do that

    Profiler just runs a trace. Set up the trace script to run in a job. Set the job to start at 8am. The procedure sp_trace_create does have an optional end time parameter, so just set that.

    See this article[/url] for an example of setting up a trace from sql commands.

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

  • SQL Agent can be used to create the schedule. As posted above, you just need to run a script to start a trace. I recommend output to a file.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply