SMSUG.ca

...your virtual communITy
Welcome to SMSUG.ca Sign in | Join | Help
in Search

Garth Jones

Find everyone with two or more workstations

SELECT
    CS.UserName0
Into
    #tmp
FROM   
    dbo.v_GS_Computer_system CS
group by
    CS.UserName0
Having
    Count(CS.UserName0) > 1

SELECT
    CS.Name0,
    CS.Manufacturer0,
    CS.Model0,
    CS.UserName0
FROM   
    dbo.v_GS_Computer_system CS,
    #tmp
Where
    #tmp.UserName0 = CS.UserName0
    or CS.UserName0 != Null
Order by
    CS.UserName0,
    CS.Name0,
    CS.Manufacturer0,
    CS.Model0

Drop table #tmp

Published Oct 28 2008, 12:56 PM by Garth
Filed under: , , ,

Comments

No Comments

This Blog

Syndication

News

Training

Powered by Community Server (Non-Commercial Edition), by Telligent Systems