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

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 50
  • Last Modified:

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

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
tommyboy115
Asked:
tommyboy115
  • 13
  • 8
1 Solution
 
Jonathan KellyCommented:
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
 
tommyboy115Author Commented:
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
 
Dustin SaundersDirector of OperationsCommented:
Can you script the table out and paste the result so we can see the layout of the columns?
sqlTable.png
0
Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

 
Jonathan KellyCommented:
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
 
Jonathan KellyCommented:
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
 
Jonathan KellyCommented:
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
 
Jonathan KellyCommented:
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
 
tommyboy115Author Commented:
Since this is a production server, would dropping the index while live create any adverse issues?
0
 
tommyboy115Author Commented:
Here is the table config.  DEAL_STSID is the field at issue.
table.txt
0
 
Jonathan KellyCommented:
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
 
Jonathan KellyCommented:
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
 
Jonathan KellyCommented:
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
 
tommyboy115Author Commented:
It's multiple rows with the issue, but how can I tell if a row is locked or not?
0
 
tommyboy115Author Commented:
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
 
Jonathan KellyCommented:
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
 
Jonathan KellyCommented:
Is the error only related to record 240364 ?
0
 
Jonathan KellyCommented:
Were you able to confirm that there are no other processes interacting with the record when you try to edit ?
0
 
tommyboy115Author Commented:
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
 
tommyboy115Author Commented:
In this latest episode, I stopped SQL server and started it again to fix the problem.
0
 
Jonathan KellyCommented:
You can use sp_who and sp_who2 along with sp_lock as a staring point.
0
 
tommyboy115Author Commented:
The problem ended up being table-level locking.
0
 
Jonathan KellyCommented:
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

  • 13
  • 8
Tackle projects and never again get stuck behind a technical roadblock.
Join Now