SQL Server 2005 Profiler save multiple traces to the same table

Posted on 2011-05-02
Last Modified: 2013-11-05
Hi All,

My customer has a question and I don't have an environment to test this. But he is currently saving SQL traces to a SQL table. The problem is when the trace ends (for whatever reason, he says when the target server restarts the trace ends), then saving to that table ends. Which means that the next time he starts a trace and he wants to use the same table name, then it asks him if he wants to overwrite the table or cancel. If he clicks overwrite, then he loses all the trace data he collected before, if he clicks cancel, then he is unable to continue with the trace.

How can he resume saving trace information to the same table?

Question by:Dangeriz
    LVL 42

    Accepted Solution

    There is no way to resume a trace by appending to an old trace output.  You would need to create a separate output and combine them in post-processing.
    LVL 9

    Assisted Solution

    First of all it is not a good practise to store profiler trace data to a database table. By doing this your loading SQL Server with extra workload. It is always recomended to use a OS file to store trace data.

    For your orginally question, you'll have to give new name for the table each time otherwise it will be truncated. Having different files you can use UNION to join them and get the result in to a single result set.
    LVL 4

    Author Closing Comment

    I guess the customer will have to resort to post-processing the results.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Introduced in Microsoft SQL Server 2005, the Copy Database Wizard ( is useful in copying databases and associated objects between SQL instances; therefore, it is a good migration and upgrade tool…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
    Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now