I have a tricky and fascinating case and a constellation I can't refer to any query I've seen before. Anyone give me a hint of how to handle this?
I have this query that creates a column that is used to display a text with highlighted Keywords.The Keywords come from a table Keywords with the column KEYWORD
How do have to join the table with the query in order that any keyword is applied the Replace command to, so that the final text includes all html commands to highlighten all keywords that exist in the displayed text.
SELECT REPLACE(CAST(TEXT as nvarchar(max)), KEYWORD, '<span style=background-color:yellow>' + 'KEYWORD' + '</span>') as Display from SALESLINE WHERE ITEMID = (SELECT ITEMID from SALESLINE where RECID = @RECID)