Problems with select in multiple tables

3

I'm trying to do the conversion from a select sql server to the Dapper, as it was too big, I'm wanting to make it leaner and readable ... But this error appearing in some parts

SELECT
    email.assunto [Assunto],
    disp.cod_disparador [DisparadorID],
    p.Desc_Pessoa [DescricaoPessoa],
    ee.cod_Email_Auto_Config_Disparador_Email_Empresa [EmailDisparadorConfigID]
FROM 
    CL2_Empresa emp,
    CL2_Email_Auto_Config_Disparador_Email email,
    CL2_Email_Auto_Config_Disparador disp,
    CL2_Pessoa p,
    CL2_Email_Auto_Config_Disparador_Email_Empresa ee 
INNER JOIN  CL2_Email_Auto_Config_Disparador_Email_Empresa 
    ON CL2_Empresa.Cod_Empresa = ee.Cod_Empresa 
INNER JOIN  CL2_Pessoa 
    ON CL2_Empresa.Cod_Pessoa = CL2_Pessoa.Cod_Pessoa 
RIGHT OUTER JOIN    CL2_Email_Auto_Config_Disparador 
INNER JOIN  CL2_Email_Auto_Config_Disparador_Email 
    ON CL2_Email_Auto_Config_Disparador.cod_disparador = CL2_Email_Auto_Config_Disparador_Email.cod_disparador 
    ON ee.cod_disparador_email = CL2_Email_Auto_Config_Disparador_Email.cod_disparador_email
WHERE 
    (disp.cod_disparador = 2)

But on these two lines, the error message appears:

  

(the mult-part identifier "field name" could not be bound)

CL2_Email_Auto_Config_Disparador_Email_Empresa ON CL2_Empresa.Cod_Empresa = ee.Cod_Empresa INNER JOIN CL2_Pessoa ON CL2_Empresa.Cod_Pessoa = CL2_Pessoa.Cod_Pessoa RIGHT OUTER JOIN
    
asked by anonymous 19.09.2016 / 17:46

1 answer

0
SELECT email.assunto [Assunto]
      ,disp.cod_disparador [DisparadorID]
      ,p.Desc_Pessoa [DescricaoPessoa]
      ,ee.cod_Email_Auto_Config_Disparador_Email_Empresa [EmailDisparadorConfigID] 
FROM  CL2_Email_Auto_Config_Disparador_Email email 
     ,CL2_Email_Auto_Config_Disparador disp
     ,CL2_Pessoa p 
     ,CL2_Email_Auto_Config_Disparador_Email_Empresa ee 
WHERE (disp.cod_disparador = 2) 
    
03.11.2016 / 03:33