PrepAway - Latest Free Exam Questions & Answers

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:

PrepAway - Latest Free Exam Questions & Answers

Answer:

Explanation:
https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqltransaction(v=vs.110).aspx

6 Comments on “How should you complete the code?

    1. null says:

      No, I think the original answer is correct. Rolling back to “inserted” state instead of “beginning” after the insert of city fails will result in the country being added to the database. Requirements state that should not be the case.




      5



      0
  1. oldovets says:

    Actual conditions are as follows:

    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 be added.




    1



    0

Leave a Reply