‎08-08-2013 02:45 AM
‎08-09-2013 06:44 PM
INSERT into tblAssetGroupLink (tblAssetGroupLink.AssetID, tblAssetGroupLink.AssetGroupID)
Select Top 1000000 tblAssets.AssetID,
'1'
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join (Select Top 1000000 tblAssetGroupLink.AssetID,
Count(tblAssetGroupLink.AssetGroupID) As Count
From tblAssetGroupLink
Group By tblAssetGroupLink.AssetID) SubQuery1 On SubQuery1.AssetID =
tblAssets.AssetID
Where tblAssetCustom.State = 1 And SubQuery1.Count = 1
Select Top 1000000 tblAssetGroups.AssetGroupID,
tblAssetGroups.AssetGroup
From tblAssetGroups
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now