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

tommyboy115
tommyboy115 used Ask the Experts™
on
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)."
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
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 ?

Author

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.
Dustin SaundersCo-Founder and Chief Architect
Top Expert 2016

Commented:
Can you script the table out and paste the result so we can see the layout of the columns?
sqlTable.png
How to Generate Services Revenue the Easiest Way

This Tuesday! Learn key insights about modern cyber protection services & gain practical strategies to skyrocket business:

- What it takes to build a cloud service portfolio
- How to determine which services will help your unique business grow
- Various use-cases and examples

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 ?
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 ?
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 ?
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 ?

Author

Commented:
Since this is a production server, would dropping the index while live create any adverse issues?

Author

Commented:
Here is the table config.  DEAL_STSID is the field at issue.
table.txt
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.
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.
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.

Author

Commented:
It's multiple rows with the issue, but how can I tell if a row is locked or not?

Author

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)
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?
Is the error only related to record 240364 ?
Were you able to confirm that there are no other processes interacting with the record when you try to edit ?

Author

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?

Author

Commented:
In this latest episode, I stopped SQL server and started it again to fix the problem.
You can use sp_who and sp_who2 along with sp_lock as a staring point.
The problem ended up being table-level locking.
I feel I was on the right track with this.

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

Cheers,
Datrias

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial