nerdexam
Microsoft

70-451 · Question #80

You have a database that contains two tables named Table1 and Table1_Details. Table1_Details contains details about items in Table1. You need to ensure that when an item is removed from Table1, all…

The correct answer is B. Create a foreign key relationship. Set Cascade Delete to True. See the full explanation below for the reasoning.

Question

You have a database that contains two tables named Table1 and Table1_Details. Table1_Details contains details about items in Table1. You need to ensure that when an item is removed from Table1, all related items are removed from. Table1_Details. You must achieve this goal by using the minimum amount of Transact-SQL code. What should you do?

Options

  • ACreate a foreign key relationship. Set Cascade Delete to Null.
  • BCreate a foreign key relationship. Set Cascade Delete to True.
  • CCreate a trigger on Table1_Details that fires on the Delete action.
  • DCreate a stored procedure that deletes all related items from Table1_Details.

How the community answered

(42 responses)
  • A
    12% (5)
  • B
    79% (33)
  • C
    7% (3)
  • D
    2% (1)

Community Discussion

No community discussion yet for this question.

Full 70-451 Practice