SMS SQL for Collections with Duplicate Names

/*
The following SQL will display any collections which appear to have a duplicate name. In some cases this may be normal, however this is a good way to find problems and inconsistencies.
*/

SELECT col.[CollectionID]
,[Name]
,[parentCollectionID]
,[Comment]
,[OwnedByThisSite]
,[ReplicateToSubSites]
,[LastChangeTime]
,[LastRefreshTime]
,[RefreshType]
,[CurrentStatus]
,[MemberClassName]
,[LastMemberChangeTime]
FROM v_Collection col
left outer join
v_CollectToSubCollect sub
on col.collectionid = sub.subCollectionid
Where Name in
(
SELECT Name
FROM v_Collection
Group By Name
Having Count(*) > 1
)
order by name, collectionid

Comments

Popular posts from this blog

SMS "Program failed (run time exceeded)" 10070

SMS "Waiting for User Condition" 10036

SMS "Waiting for content" 10035