TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Hrides Thakur
NA
292
49.7k
Find and replace multiple text string in sql server
Mar 16 2018 12:48 AM
Hi All
I have one table name EmailTemplate in that table i have a column EmailContent where i have data like below:
<div style='font-family: Verdana; font - size:10pt'>
Dear users,
<br/><br/>
__REQUEST_TYPE__ number: __NUMBER__ <br/>
Customer: __OEM_GROUP__ <br/>
Region/Division: __WORKFLOW_DIVISION__ <br/>
Program: __PROGRAM__ <br/>
Product line: __PRODUCT_LINE__ <br/>
<br/>
has been approved.<br/>
<br/>
This __REQUEST_TYPE__ was submitted with the following ratios:<br/>
With the following validation comments:
<ul> __COMMENT_LIST__ </ul>
</div>
when i select the this data, i want to replace all these bold contents e.g __REQUEST_TYPE__ with some values which i will get from another table in my select statements.
i want to avoid this kind of exercise below:
select replace(replace(replace(TemplateContent,'__REQUEST_TYPE__','Weekly'),'__NUMBER__','Twice Weekly'),'__OEM_GROUP__','china') as content from mytable;
please let me know suitable solution.
thanks.
Reply
Answers (
3
)
PIVOT with Parameters in Stored Procedure
How to search % and [ values from table