开发者

SQL Compact Lock Timeout When Update Contains a Subquery

I am using SQL Server Compact 3.5 SP2 (3.5.8085.0) and am having trouble getting a update statement to complete.

Below is my update statement:

UPDATE MyTable
 开发者_运维百科 SET ColumnB = 'SomeOtherValue'
WHERE ColumnA IN (
  SELECT TOP(90000)
    ColumnA
  FROM MyTable
  WHERE ColumnB = 'SomeValue'
  ORDER BY ColumnA
)

This query will run for anywhere between 5 seconds and 1+ hour. Very rarely it will finish, but most of the time I get:

Major Error 0x80004005, Minor Error 25090

SQL Server Compact timed out waiting for a lock. The default lock time is 2000ms for devices and 5000ms for desktops. The default lock timeout can be increased in the connection string using the ssce: default lock timeout property. [ Session id = 1,Thread id = 6876,Process id = 5712,Table name = MyTable,Conflict type = iu lock (u blocks),Resource = TAB ]

I am positive there are no other connections to this database. Only my SSMS query.

Thoughts?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜