Podcast with Grey Matter
March 22, 2025
Resolving Errors In Azure AI Search Indexer Against Blob Storage Account
March 23, 2025This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.
Section: Administration
Level: Advanced
Question:
Your session is connected to a database named PublicWorks.
You want to create a temporary stored procedure, that only lasts until your session has ended. It should be available to all other sessions while your session is still active.
How do you declare the procedure and which database is it temporarily created in?
Answer:
Session-scoped temporary stored procedures are created with a # prefix. In this case, you need a global temporary stored procedure. They are created with a ## prefix.
No matter which database you are connected to while creating these, they are created in the tempdb database.
The post SQL Interview: #30 Temporary stored procedures in SQL Server appeared first on The Bit Bucket.