How should you complete the code?

DRAG DROP
You have an Azure SQL Database that contains two tables named Country and City.
You need to insert a country into the Country table and a city into the City table. The solution must meet the following requirements;
• If an error occurs while attempting to add the country, the city must NOT be added.
• If an error occurs while attempting to add the city, the country must NOT be added.
How should you complete the code? To answer, drag the appropriate code blocks to the correct locations in the answer area. Each code block may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
Select and Place:

microsoft-exams

2 thoughts on “How should you complete the code?

  1. I think the answer is correct:
    • If an error occurs while attempting to add the country, the city must NOT be added.
    • If an error occurs while attempting to add the city, the country must NOT be added.

    Either 1 error occurs, rollback both.

  2. It should be:
    1. Save(“Inserted”)
    2. Rollback(“Inserted”) (need to rollback just part of transaction – city and commit country)
    3. Commit()
    3. Rollback(“Begining”) (can pass transaction step or name of transaction. Rollback both transactions)

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.