Events
Apr 8, 3 PM - May 28, 7 AM
Sharpen your AI skills and enter the sweepstakes to win a free Certification exam
Register now!This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to:
Azure Synapse Analytics
Returns the text of the SQL batch that is identified by the specified sql_handle
. This table-valued function replaces the system function fn_get_sql
.
Note
This syntax is not supported by serverless SQL pool in Azure Synapse Analytics.
Column name | Data type | Description |
---|---|---|
pdw_node_id | int | Unique numeric ID associated with the node. |
dbid | smallint | ID of database. For unplanned and prepared SQL statements, the ID of the database where the statements were compiled. |
objectid | int | ID of object. Is NULL for improvised and prepared SQL statements. |
number | smallint | For a numbered stored procedure, this column returns the number of the stored procedure. For more information, see sys.numbered_procedures (Transact-SQL). Is NULL for improvised and prepared SQL statements. |
encrypted | bit | 1: SQL text is encrypted. 0: SQL text is not encrypted. |
text | nvarchar(max) | Text of the SQL query. Is NULL for encrypted objects. |
The same remarks in sys.dm_exec_sql_text apply.
Require sysadmin server role or VIEW SERVER STATE
permission on the server.
Azure Synapse Analytics and Parallel Data Warehouse Dynamic Management Views (Transact-SQL)
For more development tips, see Azure Synapse Analytics development overview.
Events
Apr 8, 3 PM - May 28, 7 AM
Sharpen your AI skills and enter the sweepstakes to win a free Certification exam
Register now!