select ws.portal_ownerId, ws.portal_ownerType, ssop.provider from fsenablers..tbl_CUS_Websites ws left join tbl_SSO_Providers ssop on ssop.domainOwnerId = ws.portal_ownerId and ssop.domainOwnerType = ws.portal_ownerType and ssop.provider = and ssop.providerRole = 'SERVICE' where ws.websiteId = insert into tbl_SSO_Providers ( domainOwnerId, domainOwnerType, provider, providerRole, sharedSecret, samlVersion, comment ) values ( , , , , , , ) select ssop.provider from tbl_SSO_Providers ssop where ssop.domainOwnerId = 1665 and ssop.domainOwnerType = 'BRO' and ssop.provider = and ssop.providerRole = 'SERVICE' insert into tbl_SSO_Providers ( domainOwnerId, domainOwnerType, provider, providerRole, sharedSecret, samlVersion, comment ) values ( , , , , , , ) #_mfrPortalsHTML#