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 operatorId from tbl_OPR_CLientOperators opr where opr.ownerId = and opr.fsltablecode = and opr.fsl_choId = 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, coalesce( opr.fsl_choid, 0 ) fsl_choId, opr.operatorId, coalesce( opr.oprSegment, 0 ) as cho_segmentId from tbl_OPR_ClientOperators opr with (nolock) inner join tbl_CRM_Affiliations a with (nolock) on a.partnerId = opr.operatorId and a.partnerType = 'OPR' and a.orgType = 'OPR' and a.orgId = and a.ownerId = opr.ownerId and a.ownerType = opr.fsltablecode where nullif( opr.address, '' ) is not null and nullif( opr.city, '' ) is not null and nullif( opr.state, '' ) is not null and opr.ownerId = and opr.fsltablecode = and coalesce( opr.fsl_choId, 0 ) = 0 order by cho_name Found #qmd_compareSource.recordCount# Operators 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 =