exam questions

Exam 70-762 All Questions

View all questions & answers for the 70-762 exam

Exam 70-762 topic 1 question 26 discussion

Actual exam question from Microsoft's 70-762
Question #: 26
Topic #: 1
[All 70-762 Questions]

Note: This question is part of a series of questions that use the same scenario. For your convenience, the scenario is repeated in each question. Each question presents a different goal and answer choices, but the text of the scenario is exactly the same in each question in this series.
You have a database named DB1 that contains the following tables: Customer, CustomerToAccountBridge, and CustomerDetails. The three tables are part of the
Sales schema. The database also contains a schema named Website. You create the Customer table by running the following Transact-SQL statement:

The value of the CustomerStatus column is equal to one for active customers. The value of the Account1Status and Account2Status columns are equal to one for active accounts. The following table displays selected columns and rows from the Customer table.

You plan to create a view named Website.Customer and a view named Sales.FemaleCustomers.
Website.Customer must meet the following requirements:
✑ Allow users access to the CustomerName and CustomerNumber columns for active customers.
✑ Allow changes to the columns that the view references. Modified data must be visible through the view.
✑ Prevent the view from being published as part of Microsoft SQL Server replication.
Sales.Female.Customers must meet the following requirements:
✑ Allow users access to the CustomerName, Address, City, State and PostalCode columns.
✑ Prevent changes to the columns that the view references.
✑ Only allow updates through the views that adhere to the view filter.
You have the following stored procedures: spDeleteCustAcctRelationship and spUpdateCustomerSummary. The spUpdateCustomerSummary stored procedure was created by running the following Transacr-SQL statement:

You run the uspUpdateCustomerSummary stored procedure to make changes to customer account summaries. Other stored procedures call the spDeleteCustAcctRelationship to delete records from the CustomerToAccountBridge table.
When you start uspUpdateCustomerSummary, there are no active transactions. The procedure fails at the second update statement due to a CHECK constraint violation on the TotalDepositAccountCount column.
What is the impact of the stored procedure on the CustomerDetails table?

  • A. A. The value of the TotalAccountCount column decreased.
  • B. The value of the TotalDepositAccountCount column is not changed.
  • C. The statement that modifies TotalDepositAccountCount is excluded from the transaction.
  • D. The value of the TotalAccountCount column is not changed.
  • E. The value of the TotalDepositAccountCount column is increased.
  • F. The statement that modifies TotalAccountCount column is excluded from the transaction.
  • G. The value of the TotalDepositAcountCount column is decreased.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
New_user
Highly Voted 5 years, 5 months ago
The E is also right. Are multiple answers possible in this kind of questions?
upvoted 16 times
Bartek
5 years, 5 months ago
agree, E is correct also
upvoted 6 times
...
amar111
5 years, 1 month ago
E cannot be correct , in all scenarios . If totalDepositAccountCount had value 100 initially , then after update it will be reduced to 1.
upvoted 2 times
...
Anette
5 years ago
You mean B?
upvoted 1 times
Anette
5 years ago
sorry, B does not stand at all.
upvoted 1 times
...
...
Andy7622
4 years, 9 months ago
I think 'E' is an impact, but 'D' isn't an impact cause transaction rolled back and no changes.
upvoted 1 times
...
...
Froze
Highly Voted 5 years, 2 months ago
C is also right - that UPDATE is before beginning the transaction and value of TotalDepositAccountCount will be increased. So answers C, D and E are right.
upvoted 5 times
...
kimalto452
Most Recent 4 years, 6 months ago
I take some ms exam, its probably say "select 2 or 3 correct answers"
upvoted 1 times
...
Luzix
4 years, 7 months ago
Tested in SQL SERVER, the result is E.
upvoted 1 times
...
Alex5x
4 years, 7 months ago
I believe the sources of the confusion here is how we understand this: "The procedure fails at the second update statement". Do they mean the second UPDATE which increases TotalAccountCount? Or do they mean the second line in the body which updates TotalDepositAccountCount? I think the reason for the failure can shed some light on that. They say: "due to a CHECK constraint violation on the TotalDepositAccountCount column". If you update TotalAccountCount, how can it violate CHECK constraint on TotalDepositAccountCount column? No way. So, this is the first UPDATE which failed.
upvoted 1 times
Alex5x
4 years, 7 months ago
The second reason for the confusion is the number of the answeres possible. If there is only one correct answer is possible, then the answer is C. The statement that modifies TotalDepositAccountCount is excluded from the transaction. That answer is correct by definition and we don't care about any failures at all. We start thinking about the failure only in case we should provide all possible answeres. So, let's assume we can provide more than one answer. In this case, the following option is correct: B. The value of the TotalDepositAccountCount column is not changed. This is because the update of the TotalDepositAccountCount failed.
upvoted 1 times
...
Alex5x
4 years, 7 months ago
Since XACT_ABORT is not set to ON (OFF is the default setting), then the next lines of code will be executed in spite of the failure of the first UPDATE. As a result, a new transaction will begin, TotalAccountCount will be increased by one and that transaction will be commited. That explains why all other options are wrong. To sum up, C and B.
upvoted 3 times
...
...
SoupDJ
4 years, 8 months ago
Option C has to be one of the correct answers. Regardless of what happens, that is definitely outside of the transaction. If what they meant was the first update failed (for TotalDepositAccountCount) the script will proceed - it won't stop (it is not inside a try/catch and XACT_ABORT is OFF). That would mean that the transaction would proceed to be started and TotalAccountCount would be increased. However, if they really did mean the second update was the one that failed, then the situation would be reversed - TotalDeposit... would increase but TotalAccount would not.
upvoted 2 times
...
stm22
4 years, 11 months ago
sorry, i did not see the minus sign in first insert. i thought it was an equal sign. the first insert will fail with the minus sign. with the minus sign, no changes to the table. B and D are possible. if the minus sign is a typo here, and is an equal sign on the exam, then E is correct
upvoted 1 times
Andy7622
4 years, 5 months ago
there should be '=' sign. It just a typo
upvoted 1 times
...
...
stm22
4 years, 11 months ago
the key question is: What is the impact of the stored procedure on the CustomerDetails table? we know the first insert ran before the begin tran, and increased the value in the CustomerDetails table. that eliminates A, B, D, G C, F don't aaply to the question above Thus E is correct.
upvoted 3 times
...
gmu
4 years, 11 months ago
People, I wrote the code and checked. The correct answer is E.
upvoted 3 times
...
gmu
5 years, 1 month ago
The correct option is D. The error is in TotalDepositAccountCount (First Update). Hence, the rest of the commands didn't execute.
upvoted 2 times
Chocho
4 years, 11 months ago
You right ! D is correct because the question is "What is the impact of". The rest of the commands didn't execute
upvoted 1 times
Andy7622
4 years, 9 months ago
Impact is that TotalDepositAccontCount is increased, 'TotalAcountCount isn't changed ' means no impact.
upvoted 1 times
...
...
...
lukadataowner
5 years, 2 months ago
Update CustomerDetails SET TotalDepoositAccountCount-TotalDepositAccountCount+1 is a syntax error, the stored procedure fail. B and D is also right
upvoted 1 times
AndroJS
5 years ago
That´s a typing mistake , it must be a "=" symbol
upvoted 2 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...