SQL 2008 上使用临时表和 select 语句的 NOLOCK 问题
我使用的是 SQL 2008,大多数时候运行存储过程时都会遇到错误。错误是:由于数据移动而无法使用 nolock 继续扫描
。我在网上查了一下,似乎大多数人在更新 SQL 版本或进行更新/删除时都会遇到这个问题。我也不做。另外,解决方案似乎是删除 NOLOCK,但我没有使用 NOLOCK(除非它是 SQL Server 2008 中的默认设置)。我还尝试插入 SET TRANSACTION ISOLATION LEVEL READ uncomlated
但它尚未做出任何更改。
我的存储过程包括获取参数、创建临时表、仅使用 SELECT 语句填充表,然后从表中获取信息。
有谁知道出了什么问题吗?
I am using SQL 2008 and I am getting an error most of the time I run a stored procedure. There error is: could not continue scan with nolock due to data movement
. I have looked online for this and it seems that most people get this when updating their SQL version or when doing updates/deletes. I am not doing either. Also the solution seems to be to remove the NOLOCK yet I am not using NOLOCK (unless it is default in SQL Server 2008). I have also tried to insert SET TRANSACTION ISOLATION LEVEL READ uncommitted
yet it hasn't made any changes.
My stored procedure consists of getting parameters, creating a temporary table, filling the table with SELECT statements only and then fetching information from the table.
Does anyone know what is wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SQL Server 2008 中有一个针对此问题的补丁: 修复:当您运行将数据插入到的查询时,您会收到错误 605 和错误 824 SQL Server 中的临时表
(已修复链接。哎呀)
There's a patch for that in SQL server 2008: FIX: You receive error 605 and error 824 when you run a query that inserts data into a temporary table in SQL Server
(fixed link. oops)