首页 > 解决方案 > 当我想编辑 SQL Server 视图时,我收到此错误“乐观并发控制错误”

问题描述

我有两张桌子table_1Table_2; 我在 SQL Server 中创建了这个视图:

SELECT dbo.Table_1.ID, dbo.Table_1.Title, dbo.Table_2.Descc
FROM dbo.Table_1 
LEFT OUTER JOIN dbo.Table_2 ON dbo.Table_1.ID = dbo.Table_2.ID

但是当我想在Descc列中输入数据时,出现错误

乐观并发控制错误

标签: sqlsql-server

解决方案


This issue occurs if the following conditions are true:
The table contains one or more columns of the text or ntext data type.
The value of one of these columns contains the following characters:
Percent sign (%)
Underscore (_)
Left bracket ([)
The table does not contain a primary key.
Note This issue also occurs when you try to use Table Designer in Microsoft Visual Studio 2005 to update a table that is in a SQL Server 2005 database.

Workaround To work around this issue, create a new query window in SQL Server Management Studio. Then, run a SQL UPDATE statement to update the row in the table.

Note If you receive the first error message that is mentioned in the "Symptoms" section, you can click Yes to update the row. microsoft link


推荐阅读