Parsing @tags from a SQL text field
* This article, and all our great SQL (General) documentation, Is available on the SQL (General) menu
Modern applications rely heavily on user-generated content, and with that comes the need to identify and react to tagged users inside free-form text. SQL Server doesn’t offer a built-in tag parser, but with a bit of pattern logic and defensive coding, we can create one that’s fast, predictable, and easy to maintain. In this article, I’ll break down the function I use to extract tags from comment fields and explain the reasoning behind each step.
|