If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Microsoft SQL Server > Monitoring SQL Server

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-19-11, 04:06
wasi_shez wasi_shez is offline
Registered User
 
Join Date: Dec 2011
Posts: 3
Monitoring SQL Server

Hi
I want to monitor my SQL Server.

Scenario:
There is only one Username and Hundreds of Users connecting from different machines on same server.

I want to Monitor :

Machine Name of the User from He connected the SQL Server.

Any way?

Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 12-19-11, 12:49
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,609
A lot depends on what version of SQL Server you're using and what tools the client machines are using to connect to your SQL Server. You can probably get by with just:
Code:
SELECT hostname
   FROM master.dbo.sysprocesses
   WHERE  50 <= spid
-PatP
__________________
In theory, theory and practice are identical. In practice, theory and practice are unrelated.
Reply With Quote
  #3 (permalink)  
Old 12-20-11, 03:14
wasi_shez wasi_shez is offline
Registered User
 
Join Date: Dec 2011
Posts: 3
SELECT hostname
FROM master.dbo.sysprocesses
WHERE 50 <= spid

Does this possible to fetach this all info through Date and time?
Reply With Quote
  #4 (permalink)  
Old 12-20-11, 04:00
aflorin27 aflorin27 is offline
Registered User
 
Join Date: Apr 2008
Location: Iasi, Romania
Posts: 317
SQL Server Profiler
__________________
Florin Aparaschivei
Iasi, Romania
Reply With Quote
  #5 (permalink)  
Old 12-21-11, 09:41
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,609
Quote:
Originally Posted by wasi_shez View Post
Does this possible to fetach this all info through Date and time?
Please re-phrase this question. I don't understand.

-PatP
__________________
In theory, theory and practice are identical. In practice, theory and practice are unrelated.
Reply With Quote
  #6 (permalink)  
Old 12-21-11, 09:53
wasi_shez wasi_shez is offline
Registered User
 
Join Date: Dec 2011
Posts: 3
I mean if i want to put the filter on the same query of Date or time

then?
Reply With Quote
  #7 (permalink)  
Old 12-21-11, 17:07
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,609
The master.dbo.sysprocesses table shows the conditions of the connections to this server at this particular instant. It shows when that connection logged in (was created), and when the last batch was submitted from the client to the server.

You can not query master.dbo.sysprocesses to see what happened six hours, days, months, etc ago. It only shows sessions that are connected to the server right now.

-PatP
__________________
In theory, theory and practice are identical. In practice, theory and practice are unrelated.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On