Temporary Stored Procedures

SQL Server enables you to create private and global temporary stored procedures. Temporary stored procedures are analogous to temporary tables in that they can be created with the # and ## prefixes added to the procedure name. The # prefix denotes a local temporary stored procedure; ## denotes a global temporary stored procedure. A local temporary stored procedure can be executed only by the connection that created it, and the procedure is automatically deleted when the connection is closed. A global temporary stored procedure can be accessed by multiple connections and exists until the connection used by the user who created the procedure is closed and any currently executing versions of the procedure by any other ...

Get Microsoft® SQL Server 2008 R2 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.