Your requests do different things. What is the semantics of the query, which should be? Should it return max(Key) , including the effect of idle transactions, as your version of SQL Server indicates? If so
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; select max(Key) from MyTable;
It is the same semantics. The syntax should work fine on both AFAIKs.
If you need the last highlighted max(Key) instead, you will need to modify the SQL Server database to use a secure snapshot lock by default, so it behaves similarly to Oracle. Or, alternatively, you could achieve similar semantics with the ROWLOCK,READPAST , but then again you need two different queries.
source share