Data has always changed(SQL Server Management Studio)

若如初见. 提交于 2019-12-30 12:52:28

问题


I am using SQL Server Management studio and keep getting the same error, and the only way to get rid of it(usually) is to reset the SQL server(which is very annoying, and sometimes impossible from my remote machine)

When I add a row to a table, and then I goto "Edit Top 200 Rows" it all displays and acts fine, and I go to a field I want to change. Then I change something like 0 -> 1 and then I get a nice friendly popup saying "Data has changed since the Results Pane was last retrieved... Optimistic Concurrency Control Error" If from here I say "Yes to commit changes to database anyway" I get "No row updated... The updated row has changed or been deleted since data was last retrieved"

It's a very annoying little thing, cause I don't like having to look up RIDs and then make an update statement(and possibly having to worry about escaping 's by hand)

Is there some way to turn this concurrency checking off or something? I know the row wasn't updated or anything, and I tried completely closing Sql Server Management Studio and reopening to no avail, and also tried refreshing the result pane, or refreshing the column view. Nothing gets rid of this error, but if I do a "update ... set ...=..." then it works, so I'm not really having any concurrency error..


回答1:


I had exactly the same problem. It looks like this article was pretty good at solving it. Seems all sorts of buggy things in some versions.

See: You may receive an error message when you try to use SQL Server Management Studio to update a row of a table in SQL Server 2005.

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.



回答2:


http://social.msdn.microsoft.com/Forums/en-US/sqldatabaseengine/thread/7bf48a75-58a0-41d7-b514-b804a49ae8ff/

it seems to be a bug in SSMS I don't think I have over 4000 characters, but I can confirm this only happens on rows that have more data than others.. there seems to be some abritary limit that I can't quite put my finger on..

So, plainly SSMS is complete crap. I'll be looking for a new SQL manager..




回答3:


You shouldn't edit a table directly from the table view.. you should use an UPDATE sql command.



来源:https://stackoverflow.com/questions/1457676/data-has-always-changedsql-server-management-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!