| Login

Search this Blog


Links I like to keep around


Here are the most recent postings to this blog. Use the archive calendar or search to find other entries.
Dec12

Written by:R Teachout
12/12/2007 6:10 PM 

Run a query against sysprocesses to figure out what is going on on a SQL Server

Use Master
Select Spid 'Session ID', Nt_UserName 'User Name',HostName 'Machine Name', SysProcesses.dbid 'DB id', sysdatabases.name 'Database Name', LogiName 'Logon Name', Program_Name Application, Convert(VarChar(30), login_Time, 100) 'Time Stamp'
From SysProcesses 
INNER join sysdatabases on SysProcesses.dbid=sysdatabases.dbid
where Nt_UserName Not In ('sa', 'System') And LogiName <> 'sa' 
order
by name

 

Tags:

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
CAPTCHA image
Enter the code shown above in the box below
Add Comment  Cancel 

To succeed in the world it is not enough to be stupid, you must also be well-mannered.
-Voltaire

Inspired by Nina