CURRENT_REQUEST_ID
system function
What changes
- Input
- arguments or engine/session state
- Output or change
- value
- Return type
- smallint
Syntax at a glance
CURRENT_REQUEST_ID()
Work example
Read the request id for the current session request during diagnosis.
Read state in the intended scope and immediately after the statement it describes. Treat host values as untrusted.
Check your work Pair it with session and time because it is not a durable global identifier.
Open Microsoft Learn for full syntax, permissions, and details for your version.