Developing SQL Databases — Question 3
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 an application to track customer sales.
You need to create a database object that meets the following requirements:
- Return a value of 0 if data inserted successfully into the Customers table.
- Return a value of 1 if data is not inserted successfully into the Customers table.
- Support logic that is written by using managed code.
What should you create?
Answer options
- A. extended procedure
- B. CLR procedure
- C. user-defined procedure
- D. DML trigger
- E. DDL trigger
- F. scalar-valued function
- G. table-valued function
Correct answer: B
Explanation
The correct answer is B, CLR procedure, as it allows for managed code execution and can return specific values based on the success or failure of an operation. Options A, C, D, E, F, and G do not support the use of managed code or do not meet the requirement of returning distinct values based on the success of the data insertion.