Developing SQL Databases — Question 83
Note: this question is part of a series of questions that use the same or similar answer choices. An answer choice may be correct for more than one question in the series. Each question is independent of the other questions in the series. Information and details provided in a question apply only to that question.
You are developing and application to track customer sales.
You need to create an object that meet the following requirements:
- Run managed code packaged in an assembly that was created in the Microsoft.NET Framework and uploaded in Microsoft SQL Server.
- Run within a transaction and roll back if a future occurs.
- Run when a table is created or modified.
What should you create?
Answer options
- A. extended procedure
- B. CLR procedure
- C. user-defined procedure
- D. DML trigger
- E. scalar-valued function
- F. table-valued function
- G. DDL trigger
Correct answer: B
Explanation
The correct answer is B, CLR procedure, as it allows for managed code execution and can be used in conjunction with transactions. Options A (extended procedure) and C (user-defined procedure) do not meet the requirements for managed code in the .NET Framework. D (DML trigger) and G (DDL trigger) are related to table events but do not support managed code execution. E (scalar-valued function) and F (table-valued function) are not designed to handle transactions in the same way.