DYK (SQL Trivia): SQL Server has local(#)/global(##) temp procedures?

 

Yes, you read it right. I am surprised to find these never known, never heard SQL constructs and apparently these originated from Sybase to SQL Server. I am NOT completely sure how and when these are useful. SQL Community at MSFT Social also didn’t think much of these unknown SQL constructs.

Here is the quote from BOL.

Local or global temporary procedures can be created by using one number sign (#) before procedure_name (#procedure_name) for local temporary procedures, and two number signs for global temporary procedures (##procedure_name).

http://msdn.microsoft.com/en-us/library/aa258259(SQL.80).aspx

http://msdn.microsoft.com/en-us/library/ms187926.aspx Locations of visitors to this page