select broker_Name, img.image, img.imageMini, oneFSschoolsPartner
from tblBrokers b with (nolock)
inner join qryImageFullPathLookup img
on b.BrokerCompanyLogo = img.ImageID
where broker_Id =
select attrId
from tbl_ORG_Attributes with (nolock)
where attrDescription =
_secId = "5171"; // CMM Section ID for '1FS Boker Partner' (on DEV)
_leftColCatId = "33541";
_brokerFilterID = qmd_getBrokerCMMFilterId.attrId;
_featuredProductCatId = "33538";
_featuredBrandCatId = "33539";
_featuredVideoCatId = "33540";
_brokerProfileCatId = "33537";
_bannerImage = "33343";
_secId = "5171"; // CMM Section ID for '1FS Boker Partner' (on PROD)
_leftColCatId = "33541";
_brokerFilterID = qmd_getBrokerCMMFilterId.attrId;
_featuredProductCatId = "33538";
_featuredBrandCatId = "33539";
_featuredVideoCatId = "33540";
_brokerProfileCatId = "33537";
_bannerImage = "33343";
select contentPath
from qryContentFullPathLookup
where contentId =
select *
from qmd_featuredContentCandidates
where attrId in (#_featuredProductCatId#, #_featuredBrandCatId#, #_featuredVideoCatId#)
select imgUrl, linkToUrl, teaserTxt, linkToTarget, displayRank
from qmd_featuredContent
where attrId =
order by displayRank
select imgUrl, linkToUrl, teaserTxt, linkToTarget, displayRank
from qmd_featuredContent
where attrId =
order by displayRank
select imgUrl, linkToUrl, teaserTxt, linkToTarget, displayRank
from qmd_featuredContent
where attrId =
order by displayRank
select territoryId
from tbl_OPR_clientOperators with (nolock)
where fsl_choId =
and ownerId =
and fslTableCode = 'BRO'
select territoryId
from tbl_OPR_clientOperators with (nolock)
where fsl_choId =
and ownerId =
and fslTableCode = 'BRO'
select mfr.mfr_id
from tbl_MFR_ClientManufacturers cm with (nolock)
inner join tblManufacturers mfr with (nolock)
on cm.mfr_id = mfr.mfr_id
cross join tblBrokerOffices bo with (nolock)
inner join tblBrokers bro with (nolock)
on bro.broker_id = bo.broker_id
left outer join tbl_UT_Zipcodes_3D z3 with (nolock)
on z3.zipcode_3d = left( bo.broker_zip, 3 )
left outer join tbl_TER_ZipcodeLink zcl with (nolock)
on zcl.zip3d_id = z3.zip3d_id
left outer join tblMFRBrokerLink mbl with (nolock)
on mbl.mfr_id = mfr.mfr_id
and mbl.broker_office_id = bo.broker_office_id
left outer join tbl_SMA_BrokerOfficeLink bol with (nolock)
on bol.mfr_id = mfr.mfr_id
and bol.brokerOfficeId = bo.broker_office_id
where bo.broker_id =
and zcl.territoryId =
and cm.ownerId =
and cm.ownerType =
group by mfr.mfr_id, mfr.mfr_name
having sum( case when mbl.broker_office_id > 0 and bol.brokerOfficeId > 0 and bol.territoryId > 0 then 1 else 0 end ) > 0
order by mfr.mfr_name
select mfr_name, mfr_id, brand, brand_id, brandSkuCount
from qmd_getOneFSBrands
where mfr_id in (#_brokerMfrIds#)
order by mfr_name, brand
select mfr_id, mfr_name
from qmd_filterOneFSBrands
order by mfr_name
select distinct mfr_id
from qmd_mfrIds_col1_raw
order by mfr_name
select mfr_name, mfr_id, brand, brand_id, brandSkuCount
from qmd_filterOneFSBrands
where mfr_id in ( #_mfrIds_col1# )
order by mfr_name, brand
select mfr_name, mfr_id, brand, brand_id, brandSkuCount
from qmd_filterOneFSBrands
where mfr_id not in ( #_mfrIds_col1# )
order by mfr_name, brand
select brand, logo
from tbl_MFR_brands with (nolock)
where brand_Id in (#_brandIdList#)
order by brand