How to: Configure SQL Tracing for Database Troubleshooting

Version 2

    Introduction

    SQL Tracing can often be useful when troubleshooting issues relating to a SQL Database, below are a few scenarios where SQL Tracing might be useful.

     

    1. Functions in the Management Server console are not working as expected

    2. Functions in the Environment Manager (Personalization) console are not working as expected

    3. Database upgrade issues where the Server Configuration Portal reports SQL problems

    Detail

    Follow the steps below to configure SQL Tracing in SQL Management Studio.

     

    1) Open 'SQL Server Profiler' from within the 'SQL Management Studio'

    2) Connect to the relevant SQL instance

    3) Navigate to the "Events Selection" tab

    4) Tick "Show All Events"

    4) Expand "Errors and Warnings" events

    5) Tick "Exception", "Execution Warnings", "User Error Message" and "Error Log"

    6) Untick "Show All Events"

    7) Tick "Show All Columns"

    8) Select the "DatabaseName" and "Error" columns for all possible events

    9) Untick "Show All Columns"

    10) Click "Column Filters"

    11) In the left-hand list, select "DatabaseName", expand "Like" on the right-hand side and type the exact name of the relevant database

    12) Click "OK"

    13) Click "Run"

    14) Recreate the issue

    15) Stop the trace via "File" > "Stop Trace"

    16) Save the trace via "File" > "Save As" > "Trace File"