all groups > sql server connect > august 2006 >
You're in the

sql server connect

group:

tracking SPID back to the user or client


Re: tracking SPID back to the user or client Andrew J. Kelly
8/22/2006 12:00:00 AM
sql server connect:
I don't know how to trace it back to a specific user but I doubt that will
solve your problem. If that user is running the same app as everyone else
the blocker will most likely change each time. It is the app that you need
to address not the user. You can run trace to see what commands the user has
issued to get you into that spot or maybe simply using DBCC
INPUTBUFFER(spid) to see what their last command was. Then look at the app
or database code to see why it is blocking and fix the source.

http://www.support.microsoft.com/?id=224453 Blocking Problems
http://www.support.microsoft.com/?id=271509 How to monitor SQL 2000
Blocking

--
Andrew J. Kelly SQL MVP

[quoted text, click to view]

tracking SPID back to the user or client Therat
8/22/2006 2:48:02 AM
Here's a problem that I can't fix. I have an application that uses a SQL
database. The connection is made through ODBC. Also this application uses the
same username for all the connections; yes it's one of those.
Now this application generates a blocking in witch one spid is in the head
of the chain.
Looking in the Enterprise manager --> current Activity --> lock / process ID
I see the blocking process.
Looking in the Process Info at this spid I only see the default name (the
same for every user). The hostname is empty and the network address is the
mac address of the router. So left with nothing to trace it back to the real
user.
I scanned through the system tables for a clue who's responsible for this
block

With netstat I see pc’s connected to the database server.

Mssql knows were the data has to go but why can't I find out what pc is
connected to a spid????? To trace the blocking spid back to the real user.

Who can make my happy again
Re: tracking SPID back to the user or client Therat
8/22/2006 5:30:01 AM
I'f been there, tried to get what's wrong. The only thing i can see is that
the user has a cursorfetch. So the next thing I could do is trying to ask the
user what's he/she is doing. The application guy just tells my company that
it is the server that does this. Problem is the believe it, strange. The
server has been configured that sql can only use 1 processor. just in case.
The user must have something on its screen and I would like to know what.

If wred the articals you provided.


[quoted text, click to view]
Re: tracking SPID back to the user or client Arnie Rowland
8/22/2006 1:00:38 PM
That is one of the major reasons that applications should not be using
CURSORs.

During the entire time that the cursor is active, it is setting locks on the
data. Those locks are what are causing the blocking behavior.

The solution is to revisit the code and create set operations instead of
using CURSORS.

--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc

Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous


[quoted text, click to view]

Re: tracking SPID back to the user or client Andrew J. Kelly
8/22/2006 9:30:24 PM
The application guy doesn't have a clue then as to what his application is
doing. You can run a trace and at some point you should see a cursor prepare
that has the actual sql statement that the cursor is using.

--
Andrew J. Kelly SQL MVP

[quoted text, click to view]

AddThis Social Bookmark Button