outer joins in MSSQL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mkepick
    New Member
    • Sep 2007
    • 1

    outer joins in MSSQL

    migrated databases from sybase to mssql, migration exported sybase written
    queries written with the application build in query tool and imported to mssql
    databases. all db and tables migrated without errors. Regular queries without
    outer joins work fine but the outer join queries are failing with the following message: Microsoft ODBC SQL Server Driver SQL Server Query contain an
    outer-join request that is not permitted. I think the MSSQL join the was passed
    from sybase to mssql does not like the *.
    WHERE (B.processing_y r =2007 AND B.ldr_entity_id ='111')
    AND (C.ldr_entity_i d*=A.ldr_entity _id AND B.ldr_entity_id *=C.ldr_entity_ id AND B.ull_prime*=C. ull_prime)

    Can I replace the * with something that mssql recogonizes as a outer join.
    Thanks
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Originally posted by mkepick
    migrated databases from sybase to mssql, migration exported sybase written
    queries written with the application build in query tool and imported to mssql
    databases. all db and tables migrated without errors. Regular queries without
    outer joins work fine but the outer join queries are failing with the following message: Microsoft ODBC SQL Server Driver SQL Server Query contain an
    outer-join request that is not permitted. I think the MSSQL join the was passed
    from sybase to mssql does not like the *.
    WHERE (B.processing_y r =2007 AND B.ldr_entity_id ='111')
    AND (C.ldr_entity_i d*=A.ldr_entity _id AND B.ldr_entity_id *=C.ldr_entity_ id AND B.ull_prime*=C. ull_prime)

    Can I replace the * with something that mssql recogonizes as a outer join.
    Thanks
    try something like

    Code:
    select c,blah, b.blah, a.blah
    
    FROM tableC C left outer join TableA on C.ldr_entity_id =A.ldr_entity_id
        right outer join tableB on B.ldr_entity_id*=C.ldr_entity_id AND B.ull_prime*=C.ull_prime
    
    WHERE (B.processing_yr =2007 AND B.ldr_entity_id ='111')

    Comment

    Working...