如何仅在SQL Server中选择UNCOMMITTED行?
问题描述:
我正在研究需要查询实时CRM系统的DW项目.标准隔离级别会对性能产生负面影响.我很想使用未提交的未锁定/事务隔离级别.我想知道有多少行是通过脏读识别的.
I am working on DW project where I need to query live CRM system. The standard isolation level negatively influences performance. I am tempted to use no lock/transaction isolation level read uncommitted. I want to know how many of selected rows are identified by dirty read.
答
也许您可以这样做:
SELECT * FROM T WITH (SNAPSHOT)
EXCEPT
SELECT * FROM T WITH (READCOMMITTED, READPAST)
但这是天生的不道德行为.
But this is inherently racy.