Groups | Blog | Home
all groups > sql server new users > january 2005 >

sql server new users : Select works, but update query hangs


Amit
1/12/2005 3:16:03 PM
Hi,
I just started getting this problem in one of our databases. If I run a
select query, it works fine. But if I try to update something there is no
response from the server - all I see in the query analyzer is that its
running the query. The queries work fine in other databases. I took the
database offline and then brought it online again and now its working fine,
but it'll be good to know for future reference if there's anything I can do
to avoid this.
Thanks,
Amit

Sue Hoegemeier
1/12/2005 4:44:15 PM
I'd first suspect that the update ran into locking, blocking
type of problem. A select and an update will use different
locks. In the course of going offline, you may have just
killed the process that had a lock on the table preventing
the update statement from getting the locks it needed which
is why it would be fine after you went back online (and why
selects would work fine). But that's just a guess.
In the future, you can start by executing sp_who2, sp_lock
and query sysprocesses to monitor for locking, blocking
issues.

-Sue

On Wed, 12 Jan 2005 15:16:03 -0500, "Amit"
[quoted text, click to view]
Sue Hoegemeier
1/12/2005 5:23:34 PM
Enterprise Manager isn't the best tool to use to monitor for
such - you have to refresh, go back to the node, refresh, go
back to the node. It's difficult to get an accurate view of
what is going on with the activity. You really won't be able
to track it down at this point and you don't know for sure
if the spids actually did get killed unless you went back
and forth with refreshing, checking, refreshing, checking,
etc.. When/If it does come back again, try monitoring with
the system stored procedures.

-Sue

On Wed, 12 Jan 2005 19:07:11 -0500, "Amit"
[quoted text, click to view]
Amit
1/12/2005 7:07:11 PM
I did see some locks in the Management section. Then I killed all the
processes using the database and tried again - with the same result. Only
after I took the db offline and then online it started working.
Thanks,
Amit


[quoted text, click to view]

AddThis Social Bookmark Button