Trace Database Transaction Using SQL Profiler

Introduction

This article helps you to understand how to use the SQL Profiler by the step by step process and it’s very simple and also easy to understand even for the beginners.

What is SQL Profiler

Microsoft SQL Server Profiler is a graphical user interface to SQL Trace for monitoring an instance of the Database Engine or Analysis Services. You can capture and save data about each event to a file or table to analyze later.

Why to use SQL Profiler

The SQL Profiler is used for the following reasons,

  • Check the Performance of the SQL Server Database Engine.
  • Helps to debug Transact-SQL statements
  • Debug the stored procedures.
  • Can also analyze the performance of queriesexecuting.
  • Stress testing and quality and many more.

1. Access SQL Profiler: Go to SQL Server, Performance Tools, then SQL Server Profiler.



2. TRACE: Create new Trace.



3. Connect to Database using Credentials,



4. Trace Properties: Here are the properties of Trace.



Specify the Trace Name & Template:



5. Event Selection settings,



6. Column Filter: Use Column Filter option to trace what all type of query needs to be traced and also from which user the transactions need to be traced.

I selected the User level [DB Username] level tracking.



7. Execute: Click “RUN”, Trace is ready to track all the transaction details.



8. Query Execution: Connect to database and execute the query



9. Trace Details



Trace Details

10. Save Trace Records: Save the Trace File for future analysis.

Trace File


Similar Articles