70-466 · Question #74
You plan to design an application that temporarily stores data in a SQL Azure database. You need to identify which types of database objects can be used to store data for the application. The solution
The correct answer is C. temporary tables. Temporary tables are the only option that supports DDL operations like ALTER TABLE during a session, allowing schema changes while persisting data in Azure SQL.
Question
Options
- Acommon table expressions (CTEs)
- Btable variables
- Ctemporary tables
- Dtemporary stored procedures
How the community answered
(43 responses)- A7% (3)
- B2% (1)
- C86% (37)
- D5% (2)
Why each option
Temporary tables are the only option that supports DDL operations like ALTER TABLE during a session, allowing schema changes while persisting data in Azure SQL.
Common table expressions exist only for the duration of a single DML statement and cannot store data persistently or have their schema altered during a session.
Table variables declared with DECLARE @t TABLE do not support ALTER TABLE, so their schema is fixed at declaration and cannot be changed during a session.
Temporary tables (# prefix) are created in tempdb, support ALTER TABLE statements to modify columns, constraints, and indexes at any point during the session, and are automatically scoped and cleaned up when the session ends. This combination of data storage, schema mutability, and session isolation satisfies all requirements for the application.
Temporary stored procedures store executable T-SQL code, not data, and are not a mechanism for data storage or mid-session schema modification.
Concept tested: Temporary tables schema modification in Azure SQL sessions
Source: https://learn.microsoft.com/en-us/sql/t-sql/statements/create-table-transact-sql
Topics
Community Discussion
No community discussion yet for this question.