I am trying to create a view from one DW Database tables to another DW database (which is empty).
I have total 5 tables - 4 tables in one schema and another table is in another schema from same Source database.
Morg.loanNum and DevProg.loanID has 1 to many relationship.
I am getting following error:
ERROR: Msg 4104, Level 16, State 1, Line 31
--The multi-part identifier "BD.Morg.loan" could not be bound.
Because BD.Morg.loanNum and AD.DevProg.loanID has 1 to many relationship.
How can use join as i tried with LEFT OUTER JOIN, CROSS JOIN also.
My Sql is: ( i am not creating view right now as trying work on select first)
BD.Morg.loanNum, BD.Morg.stat, BD.Morg.OPbal, BD.Morg.CPbal,
AD.Addrs INNER JOIN
AD.Cnty ON AD.Addrs.CntyKey = AD.Cnty.CntyKey INNER JOIN
AD.Dev ON AD.Addrs.DevKey = AD.Dev.DevKey CROSS JOIN
AD.DevProg CROSS JOIN BD.Morg