exam questions

Exam 70-764 All Questions

View all questions & answers for the 70-764 exam

Exam 70-764 topic 1 question 134 discussion

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

DRAG DROP -
You are planning to deploy a database to Windows Azure SQL Database.
You need to design a stored procedure to update rows. The stored procedure must meet the following requirements:
✑ If more than one row is updated, an error must be raised to the application and the update must be discarded.
✑ The stored procedure must be designed to maximize concurrency.
What should you include in the design? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
Note:
- Read Committed is SQL Server's default isolation level.
- @@ROWCOUNT eturns the number of rows affected by the last statement.
- Using TRY...CATCH in a transaction
The following example shows how a TRY...CATCH block works inside a transaction.
The statement inside the TRY block generates a constraint violation error.

- Generate a constraint violation error.

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
Slava_bcd81
4 years, 9 months ago
My version: - set serializable (to maximize concurrency) -begin tran -perform update -read @Rowcount - rais Error - rais error in catch block - commit tran
upvoted 1 times
Slava_bcd81
4 years, 9 months ago
My version a bit changed: - set serializable (to maximize concurrency) - begin tran - perform update in try block - read @@Rowcount - raise Error if >1 and rollback - commit tran (if the error was not raised) - raise error in catch block (if error was raised - throw the error)
upvoted 1 times
KC
4 years, 9 months ago
Serializable is the least concurrent. It minimizes concurrent operations by being the most locked down.
upvoted 3 times
...
...
...
MSSucks
5 years, 4 months ago
There is an error in the question ... or in the answers. Question: "... if *more* than one row is updated, an error must be raised". Answer: "Raise an error ... if the row count is *less* than 1."
upvoted 1 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 ...