[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Optimistic Concurrency Setting

Posted on 2013-11-25
8
Medium Priority
?
229 Views
Last Modified: 2013-12-17
Where do I change the optimistic concurrency setting to NEVER in SSMS?

Reason for Question:

This weekend I updated to Visual Studio 2013.  I get into my SSMS 2012 and create a simple table for a simple application.  I get the optimistic concurrency control error as I play with data in the table.  Arrrrr.  I read about it and I set a primary key on the table and now I can edit/save etc.  but I get the error message each and every time.  I do some research and people say, turn it off.  Where?  

FYI - This is NOT happening to any previously built tables in SSMS.  Only my new ones after loading VS2013.

Thanks!
0
Comment
Question by:Karen Wilson
  • 4
  • 4
8 Comments
 
LVL 70

Expert Comment

by:Scott Pletcher
ID: 39675236
I don't know what specific error you're referring to:

"the optimistic concurrency control error" ??
0
 

Author Comment

by:Karen Wilson
ID: 39675252
Yes.
0
 
LVL 70

Expert Comment

by:Scott Pletcher
ID: 39675307
That's not an error message.  What is the actual error message?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Karen Wilson
ID: 39675331
Data has changed since the Results pane was last retrieved.  Do you want to save your changes now?  (Optimistic Concurrency Control Error)

Click Yes to commit your changes to database anyway.
Click No to discard your changes and retrieve the current data for this row.
Click Cancel to continue editing.

I click Yes.  Things work fine but it's time consuming.

If I highlight several rows and click Delete - it won't let me, so I delete each row individually, clicking the Yes from the above message.
0
 
LVL 70

Expert Comment

by:Scott Pletcher
ID: 39678612
There's no way around that.  SQL won't try to keep locks when you are "live editing" the table, because you could keep those locks for minutes, hours or days even.  

Instead, to keep from locking virtually everyone else out of the table for the entire time, when you go to save your mods, SQL checks to see if the related row(s) have changed during that time.

You really should learn to use DELETE, INSERT and UPDATE statements to make changes to data.
0
 

Accepted Solution

by:
Karen Wilson earned 0 total points
ID: 39714258
My question was never answered.  I guess you don't!!  

Where do I change the optimistic concurrency setting to NEVER in SSMS?
0
 
LVL 70

Expert Comment

by:Scott Pletcher
ID: 39714452
Exactly, you CAN'T.

I'll repeat the answer more clearly:

This CANNOT be done.

Or, as I put it before:
"
There's no way around that [concurrency issue].  SQL won't try to keep locks when you are "live editing" the table, because you could keep those locks for minutes, hours or days even.  
"
0
 

Author Closing Comment

by:Karen Wilson
ID: 39723474
My question was never answered.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question