Link to home
Start Free TrialLog in
Avatar of tommyboy115
tommyboy115Flag for United States of America

asked on

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)."
Avatar of Jonathan Kelly
Jonathan Kelly
Flag of Ireland image

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 ?
Avatar of tommyboy115

ASKER

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.
Can you script the table out and paste the result so we can see the layout of the columns?
sqlTable.png
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 ?
Since this is a production server, would dropping the index while live create any adverse issues?
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.
It's multiple rows with the issue, but how can I tell if a row is locked or not?
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 ?
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?
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.
ASKER CERTIFIED SOLUTION
Avatar of tommyboy115
tommyboy115
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I feel I was on the right track with this.

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

Cheers,
Datrias