Checking out dbForge’s Event Profiler for SQL Server
Tags: devart, database, sqlserver
Published: 2022-06-15 15:17:17

During our run as SQL Server DBAs, sometimes we need to capture everything going on in a particular SQL Server instance. Whether it is for troubleshooting a performance issue, capturing deadlock events, or tracking a specific activity, [SQL Profiler](https://www.devart.com/dbforge/sql/event-profiler/download.html) will give you the right set of options, so let’s give it a quick look.

**Installation**
You can get dbForge Event Profiler by clicking the **_Get For Free_** button. If you go for the [SQL Tools](https://www.devart.com/dbforge/sql/sql-tools/) Professional Trial, it will also include the whole suite of SQL Server Management Studio extensions, which adds a whole lot of extra value.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sylj84pg3zpkxbacsc0x.png) 
 
_**Note:** Make sure you have .NET Framework 4.5.2 or higher installed._

I will be showing the standalone version of the tool, so feel free to follow along either using the same version or through the SQL Server Management Studio extension.

After opening the application for the first time, click _**New**_:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/amqrt9xkxzyekdod1myu.png)  

You will be presented with the following view:

First, specify a connection string where the application will try to connect to capture the configured events. Since we don’t have any connection set up yet, click <_**Manage…**_>.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fg66z95fv0a1c6hltcun.png)  

Let’s click _**New…**_:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s2aj9oqzcy9mcuupsco6.png)  

You’ll see a regular window where you have to specify basic connection string parameters. The cool part is that you can categorize your SQL Server instance, either using any of the four presets (Development, Production, Sandbox, and Test) or creating your categories (as I already have).

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xjn4y1sajibxb634qmfz.png)  

Now, you can click _**Test Connection**_ to confirm if you have entered everything correctly:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i39rf1ecqmvgb7kjy6bl.png)  

If the connection attempt succeeds, click _**Connect**_, and you will see your new connection created:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tb7a0a7gy9rgyiqxkmm7.png) 
 
You will return back to the first screen, but with the connection setup, so the next step is to pick a template for your capturing events. It will be very familiar to you if you are used to SQL Server Profiler.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e1finhv6v0de4z2zdjr4.png)  

For simplicity, I’ll be choosing _**Standard (default)**_. A neat detail is that, depending on the template you select, it will tell you what you can achieve with that particular template.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t7qdzfqqryx56nh5hnr8.png)
  
Below the template section, you’ll see the following options:
●	You can specify a particular date & time when the trace will stop.
●	You can specify the path where the file(s) will be created.
●	You can specify the size limit (in MB) for each file.
●	You can specify the maximum number of files where the captured data will be distributed.

After setting all those parameters, click _**Next**_:

This is what you’ll see by default.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9vnvmj0ryvx3xd2qqjdp.png)  

If you tick the _**Show all**_ checkbox, then you will see a wide variety of events to capture:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ik7vijz3xau7udbx3fio.png)   

After clicking _**Next**_, you will be presented with the list of global fields that your trace will capture. Again, go through them to pick whatever you consider will be useful.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qdf63qwkdm4c4d847xis.png)  

In the next window, you can specify any desired filters in the next window to narrow your result set and have an even more digestible output.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qjfd51chjged9wapxywv.png)  

In the next window, you can customize the fields that will be captured in your event session, along with useful descriptive information for each one.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o019ygxkygl7gi11ho2d.png)  

After you click _**Execute**_, you will see the live-collected data for your configured session. If you click any of the visible rows, you will see the full command (displayed on the bottom-left section) and the list of fields, with their values, along with descriptive text for each event field (displayed on the bottom-right section).

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fze7rk47tfmz8oxiuhs3.png)  

If you want to manually stop your trace, then click the “Stop” button and a final entry named “Trace Stop” will appear.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nsi85mzdp1vijw240ky8.png)  

If you want to save this output, for post-analysis or for any other reason, click on the “Save” icon in the top toolbar.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yr4sulgo5dplbqco5zx9.png)  

That way, if you close the application and open it at a later time, then it will be available for you to open the output again:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4wtcv060z6bouzdee7ma.png)  

Back to the trace output, what if my session captured a large number of records and I want to perform searches for any matches, how can I do that? 

You either enter _**Ctrl-F**_ or navigate to the + option displayed in the screenshot.
 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/01fqcitpfpj4bu6l5orm.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uny8xbyrauilamdd1yxu.png)  

If you are interested in obtaining a particular SQL Statement, you can either copy/paste it from the bottom-left section by clicking on top of the desired one, or you can right-click on the row that contains it and specify _**Extract Event SQL statement to**_.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c6snukbwj1m86e5sv83y.png)  

That was a very brief demonstration of what Event Profiler can help you with. I hope you have found this helpful.

**Final thoughts**
●	If you’d like to get more information about Event Profiler, you can check Devart’s official [documentation center](https://docs.devart.com/event-profiler-for-sql-server/).

●	You might be thinking “why would I pick dbForge Event Profiler over SQL Server Profiler if both do basically the same?”. That’s a very good question, and my best answer to you would be the fact that Microsoft has already deprecated SQL Server Profiler, which means that they will eventually kill the feature in a future release of SQL Server. Therefore, if you heavily use the feature in your workflow, then Devart has got you covered regardless of when Microsoft decides to pull the trigger ;).