
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2010 11:54 AM
The sub-select of the above view is wrong (aka missing brackets)
should be
Otherwise the query would return a single license as a duplicate (see attached file).
Select Top 1000000
tblSerialnumber.Product,
tblSerialnumber.ProductKey,
Count(tblSerialnumber.SerialID) As Total,
TsysSerials.SerialID
From
dbo.tblComputers
Inner Join web40ActiveComputers On web40ActiveComputers.Computername = dbo.tblComputers.Computername
Inner Join tblSerialnumber On dbo.tblComputers.Computername = tblSerialnumber.Computername
Inner Join TsysSerials On TsysSerials.Product = tblSerialnumber.Product
Group By
tblSerialnumber.Product,
tblSerialnumber.ProductKey,
TsysSerials.SerialID
Having
Count(tblSerialnumber.SerialID) > 1
And TsysSerials.SerialID = 1 Or tblSerialnumber.Product Like 'Microsoft%'
should be
Select Top 1000000
tblSerialnumber.Product,
tblSerialnumber.ProductKey,
Count(tblSerialnumber.SerialID) As Total,
TsysSerials.SerialID
From
dbo.tblComputers
Inner Join web40ActiveComputers On web40ActiveComputers.Computername = dbo.tblComputers.Computername
Inner Join tblSerialnumber On dbo.tblComputers.Computername = tblSerialnumber.Computername
Inner Join TsysSerials On TsysSerials.Product = tblSerialnumber.Product
Group By
tblSerialnumber.Product,
tblSerialnumber.ProductKey,
TsysSerials.SerialID
Having
Count(tblSerialnumber.SerialID) > 1
And (TsysSerials.SerialID = 1 Or tblSerialnumber.Product Like 'Microsoft%')
Otherwise the query would return a single license as a duplicate (see attached file).
Labels:
- Labels:
-
Archive
16 REPLIES 16

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2011 05:27 PM
Can you test this one please:
Select Top 1000000 dbo.tblComputers.Computername,
dbo.tblComputers.ComputerUnique, dbo.tblComputers.Domain, Web40OSName.OSname
As OS, Duplicates.Product, Duplicates.ProductKey, Duplicates.Total,
dbo.tblComputers.Lastseen, Web40OSName.Compimage As icon
From dbo.tblComputers Inner Join
web40ActiveComputers On web40ActiveComputers.Computername =
dbo.tblComputers.Computername Inner Join
tblOperatingsystem On dbo.tblComputers.Computername =
tblOperatingsystem.Computername Inner Join
Web40OSName On Web40OSName.Computername = dbo.tblComputers.Computername
Inner Join
tblSerialnumber On dbo.tblComputers.Computername =
tblSerialnumber.Computername Inner Join
(Select Top 1000000 tblSerialnumber.Product, tblSerialnumber.ProductKey,
Count(tblSerialnumber.SerialID) As Total, TsysSerials.SerialID
From dbo.tblComputers Inner Join
web40ActiveComputers On web40ActiveComputers.Computername =
dbo.tblComputers.Computername Inner Join
tblSerialnumber On dbo.tblComputers.Computername =
tblSerialnumber.Computername Inner Join
TsysSerials On TsysSerials.Product = tblSerialnumber.Product
Group By tblSerialnumber.Product, tblSerialnumber.ProductKey,
TsysSerials.SerialID
Having Count(tblSerialnumber.SerialID) > 1 And (TsysSerials.SerialID = 1 Or
tblSerialnumber.Product Like 'Microsoft%')) Duplicates On
Duplicates.ProductKey = tblSerialnumber.ProductKey And Duplicates.Product =
tblSerialnumber.Product
Order By Duplicates.Total Desc, Duplicates.Product, dbo.tblComputers.Computer

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2011 12:31 PM
Any updates on that?
The view still contains the wrong WHERE condition. If I add the brackets as suggested in the first post the wrong output is gone...
The view still contains the wrong WHERE condition. If I add the brackets as suggested in the first post the wrong output is gone...

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2011 12:38 PM
wpa1160 wrote:
Any updates on that?
The view still contains the wrong WHERE condition. If I add the brackets as suggested in the first post the wrong output is gone...
This will be updated in the next update.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2010 09:08 AM
SELECT @@VERSION
---------------------------------------------------------------------------------
Microsoft SQL Server 2008 (SP2) - 10.0.4000.0 (X64)
Sep 16 2010 19:43:16
Copyright (c) 1988-2008 Microsoft Corporation
Standard Edition (64-bit) on Windows NT 6.0 <X64> (Build 6002: Service Pack 2)
(1 row(s) affected)
---------------------------------------------------------------------------------
Microsoft SQL Server 2008 (SP2) - 10.0.4000.0 (X64)
Sep 16 2010 19:43:16
Copyright (c) 1988-2008 Microsoft Corporation
Standard Edition (64-bit) on Windows NT 6.0 <X64> (Build 6002: Service Pack 2)
(1 row(s) affected)

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2010 02:20 PM
I can't reproduce this, which version of SQL/SP are you using?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-06-2010 04:50 PM
Problem still exists even in the current release (4.0.0.42).
I've ran your query and it returns the same wrong result.
See screenshot for details; the duplicate licenses are correctly identified before the key "VYQTD".
I've ran your query and it returns the same wrong result.
See screenshot for details; the duplicate licenses are correctly identified before the key "VYQTD".

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2010 11:55 AM
Can you test this one:
Select Top 1000000 dbo.tblComputers.Computername,
dbo.tblComputers.ComputerUnique, dbo.tblComputers.Domain, Web40OSName.OSname
As OS, Duplicates.Product, Duplicates.ProductKey, Duplicates.Total,
dbo.tblComputers.Lastseen, Web40OSName.Compimage As icon
From dbo.tblComputers Inner Join
web40ActiveComputers On web40ActiveComputers.Computername =
dbo.tblComputers.Computername Inner Join
tblOperatingsystem On dbo.tblComputers.Computername =
tblOperatingsystem.Computername Inner Join
Web40OSName On Web40OSName.Computername = dbo.tblComputers.Computername
Inner Join
tblSerialnumber On dbo.tblComputers.Computername =
tblSerialnumber.Computername Inner Join
(Select Top 1000000 tblSerialnumber.Product, tblSerialnumber.ProductKey,
Count(tblSerialnumber.SerialID) As Total, TsysSerials.SerialID
From dbo.tblComputers Inner Join
web40ActiveComputers On web40ActiveComputers.Computername =
dbo.tblComputers.Computername Inner Join
tblSerialnumber On dbo.tblComputers.Computername =
tblSerialnumber.Computername Inner Join
TsysSerials On TsysSerials.Product = tblSerialnumber.Product
Group By tblSerialnumber.Product, tblSerialnumber.ProductKey,
TsysSerials.SerialID
Having (Count(tblSerialnumber.SerialID) > 1 And TsysSerials.SerialID = 1) Or
(tblSerialnumber.Product Like 'Microsoft%')) Duplicates On
Duplicates.ProductKey = tblSerialnumber.ProductKey And Duplicates.Product =
tblSerialnumber.Product
Order By Duplicates.Total Desc, Duplicates.Product, dbo.tblComputers.Computer
