[dba-SQLServer] join pulls no records

Susan Harkins ssharkins at setel.com
Fri Dec 1 14:08:43 CST 2006

John, try a quick query on the foreign key table using a cut and paste of a
primary key value as the criteria in the foreign key field -- just to make
sure that even though the values "look" the same that they are the same. 

Susan H. 

I have two tables.  Each has an nvarchar 50 field which contains a string
consisting of the first 5 characters of about 5 different fields, which is
called in the client's industry a "match code" and is used to find the same
name / address record in a different table.  I have made the field the PK,
so there is an index and it is unique.  A join of the two tables pulls no
records.  I can manually look in the two tables and see visually identical
data, i.e. it looks like the match code matches but an inner join does not
pull records.
Any clue why not?

More information about the dba-SQLServer mailing list