What do you mean by "using the collate statment"?Depending on how many possible alternalte spellings you have, one possiblility is to create a seperate table that you could add to your join which contains your alternatives. Without the ORs and LIKEs and properly indexed it could be quite fast. Here is what I mean using names and "nicknames". If you like the idea, you might be able to find a database of alternate spellings to download from somewhere.set nocount ondeclare @People Table (FirstName varchar(30))declare @AlternateSpelling Table (FirstName varchar(30) ,NickName varchar(30))insert @People Select 'Theodore' unionSelect 'Jonathon' unionSelect 'William' unionSelect 'Susan' unionSelect 'Elizabeth'insert @AlternateSpellingSelect 'Theodore', 'Ted' UNIONSelect 'Theodore', 'Teddy' unionSelect 'Theodore', 'Theo' unionSelect 'Theodore', 'Theodore' UNIONSelect 'Jonathon', 'Jon' unionSelect 'Jonathon', 'Jonny' unionSelect 'Jonathon', 'John' unionSelect 'Jonathon', 'Jonathon' unionSelect 'William', 'Bill' unionSelect 'William', 'Willy' unionSelect 'William', 'Will' unionSelect 'William', 'William' --you'd have to experiment with the best query structure given the size of you tables, indexes etc...Select p.FirstNameFrom @People pLeft JOIN @AlternateSpelling a ON p.FirstName = a.FirstNameWhere 'Elizabeth' = isnull(a.Nickname,p.FirstName)
Be One with the OptimizerTG