Using SQL Server profilter to track SQL

Source: Internet
Author: User
Tags management studio sql server management sql server management studio

Recently, when studying the use of EF lazy loading and greedy loading, you want to see the SQL generated by LINQ. Starting with Vs--> Debugging-the window-->intellitrace event to see the generated SQL is less accurate than it is. And then think of it as if you could see SQL server2008 with SQL Server Profilter.

1. First, start SQL Server Profilter. Startup method: In SQL Server Management Studio, click the menu "Tools"-->sql Server profilter;

Enter your username and password in the popup screen and click Connect.

2. Select the Tracking property. After the connection is complete, the following screen appears

The interface has two tab, "General" tab can set the tracking name and template, tracking time, etc., if it is instant view, all by default. The main thing is to set a second tab "event Selection". Here we simply select the trace stored procedure completion event and the TSQL completion event. Also tick "Show all Columns" and tick the "DatabaseName" column in the event.

3. Here we can also select "column selector" according to our needs, to filter the event output. If we can set "DatabaseName" as our Tracking database name, if you want to perform performance optimizations such as viewing long-running SQL, you can set "Duration" to be larger than a certain threshold value.

4. View the tracked events and SQL. Once you have completed the above settings, click Run and start tracking the events we set up.

Using SQL Server profilter to track SQL

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.