I'm trying to create a view that is a join between two tables in two databases in the same SQL Server instance.
CREATE VIEW PartCostView AS SELECT ItemNmb, CSECO.dbo.MIITEM.descr, CostEach, LeadTimeDays FROM PartCost LEFT OUTER JOIN CSECO.dbo.MIITEM ON ltrim(rtrim(ItemNmb)) = ltrim(rtrim(CSECO.dbo.MIITEM.descr))
This query returns NULL for the descr field, without the left outer join it returns no rows. Doing a query in Query Analyzer is the same. If I perform the query in an external application through an ODBC driver it works correctly. ???