Home » Microsoft » 70-461 v.2 » Which Transact-SQL statement should you run?
You administer a Microsoft Azure SQL Database instance.
You are writing a new stored procedure that uses explicit transactions.
You need to ensure that no other process can affect the objects being used by the stored procedure while it is running.
Which Transact-SQL statement should you run?
A. SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
B. SET IMPLICIT_TRANSACTIONS ON
C. SET CURSOR_CLOSE_ON_COMMIT ON
D. SET XACT_ABORT ON
Correct Answer: A
Explanation/Reference:
Explanation:
SERIALIZABLE specifies the following:
Statements cannot read data that has been modified but not yet committed by other transactions.
No other transactions can modify data that has been read by the current transaction until the current transaction completes.
Other transactions cannot insert new rows with key values that would fall in the range of keys read by any statements in the current transaction until the current transaction completes.
References:
https://docs.microsoft.com/en-us/sql/t-sql/statements/set-transaction-isolation-level-transact-sql