---
id: post/duiliotacconi-com/1694
type: post
title: SQL Statement in AL Profiles
summary: SQL Statement collection in AL performance profiles, available in Business Central 2025 Wave 2 (version 27), allows developers to see which SQL queries run during profiled code execution in sampling mode. This capability helps identify database-related performance issues faster by showing the exact SQL statements executed within methods.
tier: community
language: en
tags:
  - performance profiling
  - sql tracing
  - al development
  - debugging
  - performance analysis
system: development
review:
  state: reviewed
  by: opus
  at: "2026-10-08T01:58:48.623Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-post: 1
  input_hash: 900906ff8fc78c7c49625adeb717f03ba624fe8210170b024203f93cfc8cf05f
evidence:
  - kind: blog
    url: https://duiliotacconi.com/2025/10/16/sql-statement-in-al-profiles/
    title: SQL Statement in AL Profiles
    date: "2025-10-16"
    commit: null
    t: null
    quote: null
  - kind: blog
    url: https://duiliotacconi.com/2025/10/16/sql-statement-in-al-profiles/
    title: SQL Statement in AL Profiles
    date: "2025-10-16"
    commit: null
    t: null
    quote: SQL Statement collection in AL profiles is enabled only when tracing in sampling mode and not in instrumentation mode.
  - kind: blog
    url: https://duiliotacconi.com/2025/10/16/sql-statement-in-al-profiles/
    title: SQL Statement in AL Profiles
    date: "2025-10-16"
    commit: null
    t: null
    quote: In the Method Name you will see that there are the SQL Statement collected and not just the Method itself, as in previous versions
  - kind: blog
    url: https://duiliotacconi.com/2025/10/16/sql-statement-in-al-profiles/
    title: SQL Statement in AL Profiles
    date: "2025-10-16"
    commit: null
    t: null
    quote: A real nice touch that will be helpful in pinpointing database access related performance issues in shorter time.
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
post_id: "1694"
source_id: duiliotacconi-com
source_name: Duilio Tacconi
url: https://duiliotacconi.com/2025/10/16/sql-statement-in-al-profiles/
published_at: "2025-10-16T15:38:20.000Z"
author: Duilio Tacconi
full_text: false
words: 540
quotes:
  - text: SQL Statement collection in AL profiles is enabled only when tracing in sampling mode and not in instrumentation mode.
    why_it_matters: Understanding the limitation helps developers know when they can use this feature and plan profiling strategies accordingly
  - text: In the Method Name you will see that there are the SQL Statement collected and not just the Method itself, as in previous versions
    why_it_matters: This demonstrates the key improvement - developers can now drill down from methods to see the actual SQL queries executed
  - text: A real nice touch that will be helpful in pinpointing database access related performance issues in shorter time.
    why_it_matters: Captures the practical value of the feature for developers troubleshooting performance problems
code_objects_mentioned: []
systems:
  - development
  - platform
versions_mentioned:
  - 2025 Wave 2
  - version 27
preview:
  embeddable: true
  frame_url: https://duiliotacconi.com/2025/10/16/sql-statement-in-al-profiles/embed/
  image: https://duiliotacconi.com/wp-content/uploads/2025/10/andre.jpg
  image_alt: null
  image_w: 736
  image_h: 553
  site_name: Dynamics 365 Business Central tales, myths, legends. And something serious.
  favicon: https://duiliotacconi.com/wp-content/uploads/2023/07/cropped-wordpress.png?w=32
  probed_at: "2026-10-07T11:50:53.531Z"
---

# SQL Statement in AL Profiles

[Read the post](https://duiliotacconi.com/2025/10/16/sql-statement-in-al-profiles/) · Duilio Tacconi (Duilio Tacconi, MVP) · 2025-10-16 · 540 words · tier community · reviewed (checked by Opus)

> SQL Statement collection in AL performance profiles, available in Business Central 2025 Wave 2 (version 27), allows developers to see which SQL queries run during profiled code execution in sampling mode. This capability helps identify database-related performance issues faster by showing the exact SQL statements executed within methods.

## Key points

- SQL statements are now visible in AL performance profiles through the in-client profiler, showing individual queries executed during method execution
- SQL collection works only in sampling mode, not instrumentation mode, limiting consistency of profiling data
- Available through in-client performance profiler, scheduled profiles, and snapshot debugging in Visual Studio Code
- Results can be viewed in VS Code by opening .alcpuprofile files or imported into the web client Performance Profiler tool

## Quotes

- "SQL Statement collection in AL profiles is enabled only when tracing in sampling mode and not in instrumentation mode." (Understanding the limitation helps developers know when they can use this feature and plan profiling strategies accordingly)
- "In the Method Name you will see that there are the SQL Statement collected and not just the Method itself, as in previous versions" (This demonstrates the key improvement - developers can now drill down from methods to see the actual SQL queries executed)
- "A real nice touch that will be helpful in pinpointing database access related performance issues in shorter time." (Captures the practical value of the feature for developers troubleshooting performance problems)

## Context

- Features: SQL statement profiling, in-client performance profiler, scheduled profiles, snapshot debugging, Time Spent by Application Object view, Call Tree inspection
- Versions: 2025 Wave 2, version 27

Source: Duilio Tacconi, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.
