with payables as ( select partnerPayableId, payableTo, address1, address2, city, state, zipcode, attention, payerCode, status, sourceType from tbl_TPM_partnerPayables with (nolock) where ownerId = and ownerType = and partnerId = and partnerType = and partnerPayableId = and status in ( ) ) #forJSON( 'payables', attributes.datastore, 'payableTo' )#