---
title: Debugging SQL queries with Glimpse on MVC sites
related:
  - https://docs.kentico.com/k12sp/developing-websites/starting-with-mvc-development/installing-kentico-integration-packages.md
  - https://docs.kentico.com/k12sp/developing-websites/troubleshooting-websites/debugging.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

During the development of your MVC application you may want to see which SQL queries are run on page load. To debug the executed SQL queries you can use the _Kentico.Glimpse_ [integration package](https://docs.kentico.com/k12sp/developing-websites/starting-with-mvc-development/installing-kentico-integration-packages.md).

## Setting up Glimpse in MVC application

To use Glimpse in your MVC application, you need to install the related NuGet packages and turn Glimpse on:

1. Install the required NuGet [integration packages](https://docs.kentico.com/k12sp/developing-websites/starting-with-mvc-development/installing-kentico-integration-packages.md):
   - _Kentico.Glimpse_ - adds the _Kentico SQL_ tab, which provides insight into the SQL operations that the related Kentico instance is performing.
   - _Glimpse.Mvc5_ - adds the following tabs, which provide diagnostics specific to ASP.NET MVC framework:
     - _Execution_
     - _Model Binding_
     - _Metadata_
     - _Views_
2. Run the MVC application and navigate to _/glimpse.axd_.
3. Click **Turn Glimpse On**.

The Glimpse extension is now enabled and you can use its web diagnostics features.

By default, the _Kentico SQL_ tab in Glimpse does not show any information. You need to enable SQL debugging in the Kentico settings to populate the tab:

1. Open the Kentico **Settings** application.
2. Navigate to **System** -> **Debug**.
3. In the **SQL queries** section, select the **Enable SQL query debug** option.

At this point the Kentico SQL tab in Glimpse shows the information about executed SQL queries. You can find the following information for each query:

- SQL code of the query.
- Size of the data that was **Sent** and **Received**.
- The **Duration** of the query execution.
- The full **Stack trace** of each query.

![Debugging SQL queries with Glimpse](https://docs.kentico.com/docsassets/k12sp/debugging-sql-queries-with-glimpse-on-mvc-sites/Kentico_SQL_debug_in_Glimpse.png "Debugging SQL queries with Glimpse")

> **Note:** **Note**: SQL queries executed by the MVC application are not logged in the _Debug_ of the Kentico application.
