SQL Flow Field Guide

@@PROCID

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

module context

What changes

Input
current module
Output or change
object id
Return type
int

Syntax at a glance

@@PROCID

Work example

Read the current stored module object id from inside a module.

Use schema-qualified names and test missing and permission-hidden objects separately.

Check your work Expect null outside a stored procedure, trigger, or function context.

Open Microsoft Learn for full syntax, permissions, and details for your version.