title | description | author | ms.author | ms.date | ms.service | ms.subservice | ms.topic | f1_keywords | helpviewer_keywords | dev_langs | monikerRange | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sys.query_store_query_text (Transact-SQL) |
sys.query_store_query_text (Transact-SQL) |
rwestMSFT |
randolphwest |
11/01/2024 |
sql |
system-objects |
reference |
|
|
|
=azuresqldb-current || >=sql-server-2016 || =azure-sqldw-latest || >=sql-server-linux-2017 || =azuresqldb-mi-current |
[!INCLUDE sqlserver2016-asdb-asdbmi-asa]
Contains the [!INCLUDE tsql] text and the SQL handle of the query.
Column name | Data type | Description |
---|---|---|
query_text_id |
bigint | Primary key. |
query_sql_text |
nvarchar(max) | SQL text of the query, as provided by the user. Includes whitespaces, hints, and comments. Comments and spaces before and after the query text are ignored. Comments and spaces inside text aren't ignored. |
statement_sql_handle |
varbinary(64) | SQL handle of the individual query. |
is_part_of_encrypted_module 1 |
bit | Query text is a part of an encrypted module. |
has_restricted_text 1 |
bit | Query text contains a password or other unmentionable words. |
1 Azure Synapse Analytics always returns zero (0
).
[!INCLUDE sssql19-md] and previous versions require VIEW SERVER STATE
permission on the server.
[!INCLUDE sssql22-md] and later versions require VIEW SERVER PERFORMANCE STATE
permission on the server.
- sys.database_query_store_options (Transact-SQL)
- sys.query_context_settings (Transact-SQL)
- sys.query_store_plan (Transact-SQL)
- sys.query_store_query (Transact-SQL)
- sys.query_store_runtime_stats (Transact-SQL)
- sys.query_store_wait_stats (Transact-SQL)
- sys.query_store_runtime_stats_interval (Transact-SQL)
- Monitor performance by using the Query Store
- System catalog views (Transact-SQL)
- Query Store stored procedures (Transact-SQL)
- sys.fn_stmt_sql_handle_from_sql_stmt (Transact-SQL)