/* select primary_staff AS 'tblmfrbrokerlink PrimaryStaff Orphans' from tblmfrbrokerlink where primary_staff > 0 and (select count(*) from tbl_fspro_members where fspro_userid = tblmfrbrokerlink.primary_staff) = 0 select secondary_staff AS 'tblmfrbrokerlink SecodaryStaff Orphans' from tblmfrbrokerlink where secondary_staff > 0 and (select count(*) from tbl_fspro_members where fspro_userid = tblmfrbrokerlink.secondary_staff) = 0 select distinct(SalesMgr) AS 'tbl_SMA_BrokerOfficeLink SalesMgr Orphans' from tbl_SMA_BrokerOfficeLink where SalesMgr > 0 and (select count(*) from tbl_fspro_members where fspro_userid = tbl_SMA_BrokerOfficeLink.SalesMgr) = 0 SELECT mstr_attrID AS 'tbl_ORG_AttributeLinks mstr_attrID Orphans' FROM tbl_ORG_AttributeLinks WHERE mstr_attrTypeID = 34 AND (select count(*) from tbl_fspro_members where fspro_userid = tbl_ORG_AttributeLinks.mstr_attrID) = 0 SELECT child_attrID AS 'tbl_ORG_AttributeLinks child_attrID Orphans' FROM tbl_ORG_AttributeLinks WHERE child_attrTypeID = 34 AND (select count(*) from tbl_fspro_members where fspro_userid = tbl_ORG_AttributeLinks.child_attrID) = 0 SELECT PrimaryStaff AS 'tbl_BW_Associations PrimaryStaff Orphans' FROM tbl_BW_Associations WHERE PrimaryStaff > 0 AND (select count(*) from tbl_fspro_members where fspro_userid = tbl_BW_Associations.PrimaryStaff) = 0 SELECT SecondaryStaff AS 'tbl_BW_Associations SecondaryStaff Orphans' FROM tbl_BW_Associations WHERE SecondaryStaff > 0 AND (select count(*) from tbl_fspro_members where fspro_userid = tbl_BW_Associations.SecondaryStaff) = 0 SELECT PrimaryStaff AS 'tbl_BW_DistributorLink PrimaryStaff Orphans' FROM tbl_BW_DistributorLink WHERE PrimaryStaff > 0 AND (select count(*) from tbl_fspro_members where fspro_userid = tbl_BW_DistributorLink.PrimaryStaff) = 0 SELECT SecondaryStaff AS 'tbl_BW_DistributorLink SecodaryStaff Orphans' FROM tbl_BW_DistributorLink WHERE SecondaryStaff > 0 AND (select count(*) from tbl_fspro_members where fspro_userid = tbl_BW_DistributorLink.SecondaryStaff) = 0 SELECT FSPro_UserID AS 'tbl_SEC_MemGrpLink Orphans' FROM tbl_SEC_MemGrpLink WHERE (select count(*) from tbl_fspro_members where fspro_userid = tbl_SEC_MemGrpLink.FSPro_UserID) = 0 SELECT Primary_Staff AS 'tblMfrBrokerLink Primary_Staff Orphans' FROM tblMfrBrokerLink WHERE Primary_Staff > 0 AND (select count(*) from tbl_fspro_members where fspro_userid = tblMfrBrokerLink.Primary_Staff) = 0 SELECT Secondary_Staff AS 'tblMfrBrokerLink Secondary_Staff Orphans' FROM tblMfrBrokerLink WHERE Secondary_Staff > 0 AND (select count(*) from tbl_fspro_members where fspro_userid = tblMfrBrokerLink.Secondary_Staff) = 0 SELECT FSPro_UserID AS 'tbl_FSPro_MembersCoExclude Orphans' FROM tbl_FSPro_MembersCoExclude WHERE (select count(*) from tbl_fspro_members where fspro_userid = tbl_FSPro_MembersCoExclude.FSPro_UserID) = 0 SELECT Staff1 AS 'tbl_OPR_Operators Staff1 Orphans' FROM tbl_OPR_Operators WHERE Staff1 > 0 AND (select count(*) from tbl_fspro_members where fspro_userid = tbl_OPR_Operators.Staff1) = 0 SELECT Staff2 AS 'tbl_OPR_Operators Staff2 Orphans' FROM tbl_OPR_Operators WHERE Staff2 > 0 AND (select count(*) from tbl_fspro_members where fspro_userid = tbl_OPR_Operators.Staff2) = 0 SELECT InternalContactID AS 'tbl_PRT_IndustryPartnerLink InternalContactID Orphans' FROM tbl_PRT_IndustryPartnerLink WHERE InternalContactID > 0 AND (select count(*) from tbl_fspro_members where fspro_userid = tbl_PRT_IndustryPartnerLink.InternalContactID) = 0 SELECT ContentID AS 'tbl_FSC_Content-Member Orphans' FROM tbl_FSC_Content WHERE tbl_FSC_Content.SubFolder = 'STF' AND (select count(*) from tbl_fspro_members where ImageID = tbl_FSC_Content.ContentID AND tbl_FSC_Content.ContentID <> 755) = 0