CURRENT_REQUEST_ID (Transact-SQL)

**APPLIES TO:** ![yes](media/yes.png)SQL Server (starting with 2008) ![no](media/no.png)Azure SQL Database ![no](media/no.png)Azure SQL Data Warehouse ![no](media/no.png)Parallel Data Warehouse

This function returns the ID of the current request within the current session.

Topic link icon Transact-SQL Syntax Conventions

Syntax

CURRENT_REQUEST_ID()  

Return types

smallint

Remarks

To find exact information about the current session, use @@SPID. For exact information about the current request, use CURRENT_REQUEST_ID().

See also

[@@SPID (Transact-SQL)](../../t-sql/functions/spid-transact-sql.md)