select vendor_id, vendor_name, operator_id, eai_lineNumber from tbl_IMPORT_OPR_VENDOR with (nolock) where eai_batchId = and ownerId = and ownerType = and eai_lineNumber > 0 select operatorId, fsl_choId from tbl_OPR_ClientOperators with (nolock) where mfrCustNum = and ownerId = and fslTableCode = update tbl_IMPORT_OPR_VENDOR set fseOperatorId = , fseCHOId = , fseUpdateStatus = where ownerId = and ownerType = and eai_batchId = and eai_lineNumber = select operatorId, companyName, address, address2, city,state, zipcode from tbl_OPR_ClientOperators with (nolock) where fsl_choId = and ownerId = and fslTableCode = and fsl_choId > 0 select partnerPayableId from tbl_TPM_PartnerPayables with (nolock) where partnerType = 'OPR' and partnerId = and ownerId = and ownerType = and (payerCode = or coalesce(payerCode, '') = '' ) and payableTo = update tbl_TPM_PartnerPayables set status = , updateDate = , payerCode = case when payerCode = coalesce(payerCode, '') then #_vendorId# else payerCode end, address1 = , address2 = , city = , state = , zipcode = , sourceType = , sourceId = where partnerPayableId = set nocount on insert into tbl_TPM_PartnerPayables ( ownerType, ownerId, partnerType, partnerId, payableTo, address1, address2, city, state, zipcode, payerCode,status, sourceType, sourceId, createDate , updateDate, attention ) values ( , , , , , , , , , , , , , , , , ); select partnerPayableId = @@identity set nocount off update tbl_IMPORT_OPR_VENDOR set fseUpdateStatus = where ownerId = and ownerType = and eai_batchId = and eai_lineNumber = select imp.vendor_id, imp.vendor_name, imp.operator_id,imp.operator_name from tbl_IMPORT_OPR_VENDOR imp with (nolock) where imp.ownerId = and imp.ownerType = and imp.eai_batchId = and imp.fseUpdateStatus = 'M' select partnerId as operatorId, payableTo as VendorName, payerCode as vendorId from tbl_TPM_PartnerPayables pp with (nolock) inner join tbl_OPR_ClientOperators op with (nolock) on pp.partnerId = op.operatorId and pp.ownerId = op.ownerId and pp.ownerType = op.fslTableCode where pp.ownerId = and pp.ownerType = and pp.sourceType = 'EAI' and pp.sourceId = and CAST(pp.createDate AS date) = CAST(getDate() AS date) select partnerId as operatorId, payableTo as VendorName, payerCode as vendorId from tbl_TPM_PartnerPayables pp with (nolock) inner join tbl_OPR_ClientOperators op with (nolock) on pp.partnerId = op.operatorId and pp.ownerId = op.ownerId and pp.ownerType = op.fslTableCode where pp.ownerId = and pp.ownerType = and pp.sourceType = 'EAI' and pp.sourceId = and CAST(pp.updateDate AS date) = CAST(getDate() AS date) and pp.createDate < pp.updateDate select imp.vendor_id, imp.vendor_name, imp.operator_id,imp.operator_name from tbl_IMPORT_OPR_VENDOR imp with (nolock) where imp.ownerId = and imp.ownerType = and imp.eai_batchId = and imp.fseUpdateStatus = 'X' select imp.vendor_id, imp.vendor_name, imp.fseOperatorId, op.companyName from tbl_IMPORT_OPR_VENDOR imp with (nolock) inner join tbl_OPR_ClientOperators op with (nolock) on imp.fseOperatorId = op.operatorId where imp.ownerId = and imp.ownerType = and imp.eai_batchId = and imp.fseUpdateStatus = 'X' and imp.fseCHOId = 0 and op.ownerId = and op.fslTableCode = select imp.vendor_id, imp.vendor_name, imp.operator_id,imp.operator_name from tbl_IMPORT_OPR_VENDOR imp with (nolock) where imp.ownerId = and imp.ownerType = and imp.eai_batchId = and imp.fseUpdateStatus = null