Skip to content

Instantly share code, notes, and snippets.

@TheRockStarDBA
Last active July 7, 2018 18:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheRockStarDBA/db081a15243d38ccf64a85d2de3aa091 to your computer and use it in GitHub Desktop.
Save TheRockStarDBA/db081a15243d38ccf64a85d2de3aa091 to your computer and use it in GitHub Desktop.
SELECT TOP 30 p.PersonId,
p.PersonParentId,
p.PersonName,
p.PersonPostCode
FROM dbo.People p
left join containstable (ContactFullText, '"mr" AND "ch*"') cf on cf.[yourKey] = p.PersonId
WHERE p.PersonDeletionDate IS NULL
AND p.PersonCustomerId = 24
--AND CONTAINS(ContactFullText, '"mr" AND "ch*"')
AND p.PersonGroupId IN(197, 206, 186, 198)
AND [RANK] > 0
ORDER BY p.PersonParentId,
p.PersonName;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment