nerdexam
Microsoft

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.

Build an analysis services database

Question

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 must ensure that the application can make changes to the schema of a temporary object during a session. Which type of objects should you identify?

Options

  • Acommon table expressions (CTEs)
  • Btable variables
  • Ctemporary tables
  • Dtemporary stored procedures

How the community answered

(43 responses)
  • A
    7% (3)
  • B
    2% (1)
  • C
    86% (37)
  • D
    5% (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.

Acommon table expressions (CTEs)

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.

Btable variables

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.

Ctemporary tablesCorrect

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.

Dtemporary stored procedures

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

#SQL Azure#temporary tables#schema modification#session-scoped objects

Community Discussion

No community discussion yet for this question.

Full 70-466 Practice