I have a query that calls a Function. It works on most records but on a couple instead of what I expect I get the text "#Error". I have zero idea how to track down mysterious errors, and am hoping someone can tell me how to debug this.
My query is:
ConstructName just puts the name together with proper punctuation (like "Bach; J.S.").Code:SELECT ConstructName(FirstName, LastName, BandName) AS FullName FROM Artists
Of over 600 names, 7 or 8 return #Error instead of the constructed name. I thought perhaps there were bad invisible characters from an import so I deleted and recreated one of the problem records and that didn't help.
I did put a watch on one of the bad names and the name doesn't appear to ever enter the function at all. That is, if I create a "break on true" watch on last_name = "Bach" it gets triggered, but my "break on true" for one of the problem names, "Prokofiev", is never triggered.
So how does one approach an issue like this?