select fileProcessor from tbl_EAI_inboundFileProcessors with (nolock) where ownerId = and ownertype = and fileFormat = 'COMPARE_OPERATORS_TXT' insert into tbl_EAI_inboundFileProcessors ( ownerId, ownerType, fileName, fileProcessor, fileFormat, clientProcessEmail, fseProcessEmail, allowUpload, processingWindowStartHr24, processingWindowLengthHr, defaultBatchClass ) values ( , , '^compare_operators\.txt$', '/mstrQueries/utilityQueries/DataImport/Compare/Compare.cfm', 'COMPARE_OPERATORS_TXT', 'gerry@fsenablers.com','brett@fsenablers.com','Y', 0, 24, 'Z' ) select distinct opr.companyName cho_name, opr.address cho_address, opr.address2 cho_address2, opr.city cho_city, opr.state cho_state, opr.zipcode cho_zipCode, opr.url cho_url, opr.comments cho_comments, opr.recordSource cho_recordSource, opr.fsl_choid, opr.operatorId, coalesce( opr.oprSegment, 0 ) as cho_segmentId from tbl_OPR_ClientOperators opr with (nolock) inner join tbl_OPR_DistributionDetails dd with (nolock) on dd.ownerId = opr.ownerId and dd.ownerType = opr.fsltablecode and dd.operatorId = opr.operatorId and nullif( dd.accountNumber, '' ) is not null inner join tbl_CDR_Distributors cdr with (nolock) on cdr.cdr_recordId = dd.cdr_recordId and cdr.ownerId = dd.ownerId and cdr.fsl_tablecode = dd.ownerType inner join tbl_DST_Distributors dst with (nolock) on dst.dstId = cdr.fsl_dstId and dst.dstParentCo = 4036 where opr.ownerId = and opr.fsltablecode = and coalesce( opr.fsl_choId, 0 ) = 0 order by cho_name insert into tbl_IMPORT_1FSOperators ( eai_batchId, eai_lineNumber, ownerId, ownerType , #_c# ) values ( , , , , ) update tbl_EAI_InboundBatches set loadedColumns = , lineCount = , batchTime = , statusTime = , loadedTime = , queueStatus = 0, status = 'PENDING', message = 'Waiting in line...' where batchId = and ownerId = and ownertype =