sql - Trying to join 2 tables by comparing strings in lowercase/uppercase -
hope makes sense. trying join 2 tables based on same file path string:
select distinct (vdir_physicalpath) dbo.aspr_iisvdir --gets distinct paths virtual directories --now need list records 'path' matches of rows results above; select * dbo.aspr_folderacl upper(fullname) = of rows above --notice strings lowercase/uppercase plus vdir_physicalpath has '/' --i tried inner join didnt list me anything; like: select * dbo.aspr_folderacl acl inner join dbo.aspr_iisvdir vdir on upper(acl.fullname) + '/' = upper(vdir.vdir_physicalpath) collate sql_latin1_general_cp1_cs_as -- --when comparing should use charindex(upper(fullname), vdir_physicalpath) > 0 thanks max
why not use case insensitive collation such sql_latin1_general_cp1_ci_as instead of sql_latin1_general_cp1_cs_as? afaik, save whatever slight performance penalty you're paying calling upper , allow indexes on table still used.
for more details please read collation , unicode support.
if switch collation , still have problem then, based on information provided far, there's wrong logic or might have gremlins (such zero-width space) in data.


Comments
Post a Comment