select distinct a.person, dbo.FormatNameA(p.Name), dbo.FormatNameA(p.FirstName) from PersonAlias a join Person p on p.id=a.Person where a.Name like N'London Jack%' or a.NameA like N'London Jack%' or a.NameB like N'London Jack%'
The EXECUTE permission was denied on the object 'FormatNameA', database 'xtrans', schema 'dbo'.