Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 sp_who do not return hostname:

Author  Topic 

ding03
Starting Member

6 Posts

Posted - 2009-01-30 : 04:52:05
Hello,
When i use Sp_who to see from where an
process is coming, i don't see anything under hostname.
Does anyone knows what is missing on the host computer

Thanks !!!

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-01-30 : 05:27:06
Of course hostname is present with sp_who.

See this

spid ecid status hostname loginname blk dbname cmd request_id
1 0 background sa 0 NULL RESOURCE MONITOR 0
2 0 background sa 0 NULL XE TIMER 0
3 0 background sa 0 NULL XE DISPATCHER 0
4 0 background sa 0 NULL LAZY WRITER 0
5 0 background sa 0 NULL LOG WRITER 0
6 0 background sa 0 NULL LOCK MONITOR 0
7 0 background sa 0 master SIGNAL HANDLER 0
8 0 sleeping sa 0 master TASK MANAGER 0
9 0 background sa 0 master FSAGENT TASK 0
10 0 background sa 0 master FSAGENT TASK 0
11 0 background sa 0 master FSAGENT TASK 0
12 0 background sa 0 master FSAGENT TASK 0
13 0 background sa 0 master FSAGENT TASK 0
14 0 background sa 0 master TRACE QUEUE TASK 0
15 0 background sa 0 master BRKR TASK 0
16 0 background sa 0 tempdb CHECKPOINT 0
17 0 background sa 0 master TASK MANAGER 0
18 0 background sa 0 master BRKR EVENT HNDLR 0
19 0 background sa 0 master BRKR TASK 0
20 0 sleeping sa 0 master TASK MANAGER 0
21 0 background sa 0 master BRKR TASK 0
22 0 sleeping sa 0 master TASK MANAGER 0
23 0 sleeping sa 0 master TASK MANAGER 0
24 0 sleeping sa 0 master TASK MANAGER 0
25 0 sleeping sa 0 master TASK MANAGER 0
26 0 sleeping sa 0 master TASK MANAGER 0
27 0 sleeping sa 0 master TASK MANAGER 0
28 0 sleeping sa 0 master TASK MANAGER 0
30 0 sleeping sa 0 master TASK MANAGER 0
51 0 sleeping PHBGPELA NT AUTHORITY 0 msdb AWAITING COMMAND 0
52 0 runnable PHBGPELA AD\pela 0 Test SELECT 0
53 0 sleeping PHBGPELA AD\pela 0 master AWAITING COMMAND 0
54 0 sleeping PHBGPELA AD\pela 0 Test AWAITING COMMAND 0
55 0 runnable PHBGPELA sa 0 Test SELECT 0
See the correlation between sa account and hostname when hostname is blank?

SPID 55 is explicit logged in as sa.
SPID 54 is explicit logged in as AD\Pela.
SPID 30 and below are system processes and run under sa account. These are not user processes.


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

AvanthaSiriwardana
Yak Posting Veteran

78 Posts

Posted - 2009-01-30 : 05:53:32
its a normal case even i get the same thing when execute sp_who.
:)

Avantha Siriwardana
Go to Top of Page

ding03
Starting Member

6 Posts

Posted - 2009-01-30 : 08:23:11
52 0 runnable stat dd-dc 0 AfcCookedIFSV2_OSLO SELECT
51 0 sleeping stat 51 AfcCookedIFSV2_OSLO SELECT


I use php to do some selection from another pc, then i execute sp_who with the SQL Query Analyser on the Server 'dd-dc'.
so i have 2 processus with the login stat, the first hostname is dd-dc(SQL Query Analyser), but the seconde doesn't have hostname(from another host ). how can i show the hostname of the seconde PC in the list?
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-01-30 : 08:40:16
Rewrite sp_who?



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

ding03
Starting Member

6 Posts

Posted - 2009-01-30 : 09:18:17
I don't think it's a problem of sp_who, i use easyphp to execute php code, may be i should define the hostname with apache or easyphp. but i don't knw where.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-01-30 : 09:38:18
You can set application name in your connection string and maybe also your host name.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-01-30 : 09:55:45
I would rather use sp_who2 than sp_who for detailed info regarding Program name and else.
Go to Top of Page

ding03
Starting Member

6 Posts

Posted - 2009-01-30 : 10:36:02
i don't know where to set the application name, my application php use easyphp to execute the query.and i didn't find the right config in apache or php or easyphp
sp_who2 doesn't display the hostname.
Go to Top of Page

ding03
Starting Member

6 Posts

Posted - 2009-02-01 : 18:07:46
no other answers? thanks
Go to Top of Page

ding03
Starting Member

6 Posts

Posted - 2009-02-02 : 05:37:32
quote:
Originally posted by Peso

Of course hostname is present with sp_who.

See this

spid ecid status hostname loginname blk dbname cmd request_id
1 0 background sa 0 NULL RESOURCE MONITOR 0
2 0 background sa 0 NULL XE TIMER 0
3 0 background sa 0 NULL XE DISPATCHER 0
4 0 background sa 0 NULL LAZY WRITER 0
5 0 background sa 0 NULL LOG WRITER 0
6 0 background sa 0 NULL LOCK MONITOR 0
7 0 background sa 0 master SIGNAL HANDLER 0
8 0 sleeping sa 0 master TASK MANAGER 0
9 0 background sa 0 master FSAGENT TASK 0
10 0 background sa 0 master FSAGENT TASK 0
11 0 background sa 0 master FSAGENT TASK 0
12 0 background sa 0 master FSAGENT TASK 0
13 0 background sa 0 master FSAGENT TASK 0
14 0 background sa 0 master TRACE QUEUE TASK 0
15 0 background sa 0 master BRKR TASK 0
16 0 background sa 0 tempdb CHECKPOINT 0
17 0 background sa 0 master TASK MANAGER 0
18 0 background sa 0 master BRKR EVENT HNDLR 0
19 0 background sa 0 master BRKR TASK 0
20 0 sleeping sa 0 master TASK MANAGER 0
21 0 background sa 0 master BRKR TASK 0
22 0 sleeping sa 0 master TASK MANAGER 0
23 0 sleeping sa 0 master TASK MANAGER 0
24 0 sleeping sa 0 master TASK MANAGER 0
25 0 sleeping sa 0 master TASK MANAGER 0
26 0 sleeping sa 0 master TASK MANAGER 0
27 0 sleeping sa 0 master TASK MANAGER 0
28 0 sleeping sa 0 master TASK MANAGER 0
30 0 sleeping sa 0 master TASK MANAGER 0
51 0 sleeping PHBGPELA NT AUTHORITY 0 msdb AWAITING COMMAND 0
52 0 runnable PHBGPELA AD\pela 0 Test SELECT 0
53 0 sleeping PHBGPELA AD\pela 0 master AWAITING COMMAND 0
54 0 sleeping PHBGPELA AD\pela 0 Test AWAITING COMMAND 0
55 0 runnable PHBGPELA sa 0 Test SELECT 0
See the correlation between sa account and hostname when hostname is blank?

SPID 55 is explicit logged in as sa.
SPID 54 is explicit logged in as AD\Pela.
SPID 30 and below are system processes and run under sa account. These are not user processes.


E 12°55'05.63"
N 56°04'39.26"





Can you tell me why 'SPID 30' doesn't have hostname?
and why 'SPID 52' has the hostname,can we replace its hostname by a blank space?
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-02-02 : 08:56:17
Spid less than or equal to 50 are System processes.You should not worry about them .
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-02-02 : 09:04:59
Already said...
quote:
Originally posted by Peso

SPID 30 and below are system processes and run under sa account. These are not user processes.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-02-02 : 09:11:55
quote:
Originally posted by Peso

Already said...
quote:
Originally posted by Peso

SPID 30 and below are system processes and run under sa account. These are not user processes.



E 12°55'05.63"
N 56°04'39.26"




oops I didn't notice that. That should be 50 or less.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-02-02 : 09:21:21
Yes. You are right about 50 as the limit for SQL Server system processes.
In the table with my testdata, it is 30 that is current maximum system process.


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page
   

- Advertisement -