Solved

Error when attempting to change value of INT field in SQL table.  Help!

Posted on 2016-08-03
23
41 Views
Last Modified: 2016-10-08
I have a very strange situation.  When trying to update the int value in a field, I get the error below.  The strange part is that I only get the error if the original value is certain numbers.  For example, in this case, I'm trying to change the value from 15 to 3, or really to any other number.  It will not let me change it.  If I pull up other fields with different initial values, say 3, then it changes no problem.  The field is an index, but other than that, nothing special.

Any thoughts? Let me know what other info you need.  Thanks!

Error:

"No row was updated.

The data in row 1 was not committed.
Error Source: .NetSqlClient Data Provider.
Error Message: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
The statement has been terminated.

Correct the errors and retry or press ESC to cancel the change(s)."
0
Comment
Question by:tommyboy115
  • 13
  • 8
23 Comments
 
LVL 7

Expert Comment

by:Jonathan Kelly
ID: 41741344
Where are you making the edit ?
Can you run an update statement sucessfully ?
Are there any triggers attached to the table ?
Is referential integrity involved ?

If you restore the db to another server so you get the same problem ?

Is this a production system ?
0
 

Author Comment

by:tommyboy115
ID: 41741380
I'm attempting to the make the edit in a View.  I did just notice that I CAN change the values when editing the table directly (Edit top 200 rows).  The problem seems to revolve around updating it when queried.

I can not run an update query successfully.  It just hangs.

No triggers.

No referential integrity.

I did not restore to another server yet.

This is a production system and just started happening.
0
 
LVL 12

Expert Comment

by:Dustin Saunders
ID: 41741381
Can you script the table out and paste the result so we can see the layout of the columns?
sqlTable.png
0
 
LVL 7

Expert Comment

by:Jonathan Kelly
ID: 41741388
can u drop the index and try your update.

I would drop the view and recreate it ir create another with same definition and try ur edit.

If you run the update what error do you get ?
Is there a primary key defined ?
0
 
LVL 7

Expert Comment

by:Jonathan Kelly
ID: 41741389
can u drop the index and try your update.

I would drop the view and recreate it ir create another with same definition and try ur edit.

If you run the update what error do you get ?
Is there a primary key defined ?
0
 
LVL 7

Expert Comment

by:Jonathan Kelly
ID: 41741390
can u drop the index and try your update.

I would drop the view and recreate it ir create another with same definition and try ur edit.

If you run the update what error do you get ?
Is there a primary key defined ?
0
 
LVL 7

Expert Comment

by:Jonathan Kelly
ID: 41741391
can u drop the index and try your update.

I would drop the view and recreate it ir create another with same definition and try ur edit.

If you run the update what error do you get ?
Is there a primary key defined ?
0
 

Author Comment

by:tommyboy115
ID: 41741402
Since this is a production server, would dropping the index while live create any adverse issues?
0
 

Author Comment

by:tommyboy115
ID: 41741416
Here is the table config.  DEAL_STSID is the field at issue.
table.txt
0
 
LVL 7

Expert Comment

by:Jonathan Kelly
ID: 41741481
If you can edit the table directly then the problem is with the view.

Can u post the definition ?

Are you sure the row is not locked by another process.
0
 
LVL 7

Expert Comment

by:Jonathan Kelly
ID: 41741482
If you can edit the table directly then the problem is with the view.

Can u post the definition ?

Are you sure the row is not locked by another process.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 7

Expert Comment

by:Jonathan Kelly
ID: 41741483
If you can edit the table directly then the problem is with the view.

Can u post the definition ?

Are you sure the row is not locked by another process.
0
 

Author Comment

by:tommyboy115
ID: 41741486
It's multiple rows with the issue, but how can I tell if a row is locked or not?
0
 

Author Comment

by:tommyboy115
ID: 41741488
And also, I can change the value of other fields in the row, so it's probably not locked.  Here's the view:

SELECT     DEALID, DEAL_STSID
FROM         dbo.DMS_DEALS
WHERE     (DEALID = 240364)
0
 
LVL 7

Expert Comment

by:Jonathan Kelly
ID: 41741524
If you run

update dbo.DMS_DEALS set DEAL_STSID =1
WHERE     (DEALID = 240364)
go
update dbo.DMS_DEALS set DEAL_STSID =2
WHERE     (DEALID = 240364)
go
update dbo.DMS_DEALS set DEAL_STSID =3
WHERE     (DEALID = 240364)
go

what happens ?

you can run sp_lock to view current locking info.

are you logging in as the sa?
0
 
LVL 7

Expert Comment

by:Jonathan Kelly
ID: 41741526
Is the error only related to record 240364 ?
0
 
LVL 7

Expert Comment

by:Jonathan Kelly
ID: 41742662
Were you able to confirm that there are no other processes interacting with the record when you try to edit ?
0
 

Author Comment

by:tommyboy115
ID: 41748046
So, the records suddenly became editable again.  I can only assume this had to do with locking.  I just ran into another issue where there no record updates were being allowed.  I'm not a SQL expert by any stretch.  How can I determine what is happening with regards to locking with the database?
0
 

Author Comment

by:tommyboy115
ID: 41748073
In this latest episode, I stopped SQL server and started it again to fix the problem.
0
 
LVL 7

Expert Comment

by:Jonathan Kelly
ID: 41748396
You can use sp_who and sp_who2 along with sp_lock as a staring point.
0
 

Accepted Solution

by:
tommyboy115 earned 0 total points
ID: 41783397
The problem ended up being table-level locking.
0
 
LVL 7

Expert Comment

by:Jonathan Kelly
ID: 41834925
I feel I was on the right track with this.

No worries if you dont\cant award any points in my favor.

Cheers,
Datrias
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how the fundamental information of how to create a table.

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now