dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: SQL
Expertise: Advanced
Jan 20, 2004

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


Get Details of the Aggregated Data

Say you want to get the latest processes running on Microsoft® SQL Server and their time, hostname, and the username. The following query retrieves this data:

Use Master
Select SysPro1.program_name,
SysPro1.login_time,SysPro1.MemUsage,SysPro1.Hostname,SysPro1.Hostname,SysP
ro1.nt_domain,SysPro1.nt_username
From sysprocesses SysPro1
INNER JOIN

(SELECT program_name, MAX(login_time) as T2
FROM sysprocesses
GROUP BY program_name Having len(program_name) > 0)  SysPro2
ON
( SysPro2.program_name = SysPro1.program_name
  AND
 SysPro2.T2 = SysPro1.login_time )
Dinesh Asanka
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date