Overview
The Longest Queries field in the Liongard Microsoft SQL Server Inspector captures and displays query text for diagnostic and performance insight. To maintain system performance and optimize data storage, this field displays only the first 50 characters of each query, followed by ellipses (...) when the full query exceeds this limit.
This behavior is by design and is consistent across all current versions of the SQL Server Inspector.
Why This Happens? π€¨
The 50-character limit is intentionally enforced for the following reasons:
Reason | Explanation |
Performance Optimization | Limits the processing overhead when collecting large volumes of query data from multiple SQL instances. |
UI Readability | Keeps the Inspector output clean and easy to scan by avoiding overly long text fields. |
Inspector Consistency | Ensures predictable behavior across environments and Inspector versions. |
This is not an error and does not indicate data loss or inspection failure.
What You Will See in the Inspector π§
Scenario | Inspector Output |
Query β€ 50 characters | Full query text displayed |
Query > 50 characters | First 50 characters + |
How to View the Full Query Text π€·
If full query text is required for performance tuning or troubleshooting, it can be retrieved directly from Microsoft SQL Server using Dynamic Management Views (DMVs).
β Using DMVs
Run the following query in SQL Server Management Studio (SSMS):
SELECT
SUBSTRING(qt.text, 1, 4000) AS full_query_text,
qs.execution_count,
qs.total_elapsed_time,
qs.total_worker_time
FROM sys.dm_exec_query_stats qs
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) qt
ORDER BY qs.total_elapsed_time DESC;
β Alternative Methods
Method | Description |
SQL Server Logs | Review SQL Server error logs and query traces |
Query Store | Use Query Store (if enabled) for historical query capture |
Extended Events | Capture full query text via SQL Server Extended Events |
Note: These methods are managed directly within Microsoft SQL Server and are outside of Liongard-controlled data collection.
Can the 50-Character Limit Be Increased?
At this time:
Setting | Status |
Modify limit in Inspector | β Not supported |
Disable truncation | β Not supported |
Change via configuration | β Not available |
The 50-character limit is hard-coded into the Inspector and remains consistent across all supported versions.
If your organization requires longer query capture, Liongard recommends submitting a feature request through official support channels.
When to Contact Support π¦
Contact Liongard Support if:
Situation | Reason |
Field shows empty or null data | Possible inspection failure |
Queries appear malformed | Potential encoding or permission issue |
Field missing entirely | Inspector version or permission problem |
Before contacting support, gather:
Inspector logs.
SQL Server version.
Sample screenshots of Inspector output.
Confirmation of required SQL permissions.
Best Practices π
Recommendation | Benefit |
Use SQL Server DMVs for deep analysis | Full visibility into query performance |
Enable Query Store (if supported) | Historical query tracking |
Regularly review long-running queries | Improved database performance |
Document performance baselines | Easier anomaly detection |
Third-Party Content Disclaimer βΌοΈ
This article references Microsoft SQL Server DMVs and tools. These are third-party technologies maintained by Microsoft. Liongard is not responsible for changes to syntax, availability, or behavior of Microsoft-provided features.