Learning Learning - 1 year ago 90
SQL Question

Replace comma with with different comma ، in database field

I have a field in a table where I store multiple tags separated with comma for example

tag1, tag2, tag3,tag4

I need to replace a single comma with
for Persian version
so that tags will look like

tag1، tag2، tag3،tag4،

I have over three thousand records in the database and tags are stored with either
but I want all of them to be separated with

How can I find and replace all
using SQL.

I am using SQL Server as my database.

Let us say table structure is

Table BLOG

BLOG Table fields

ID int
Title nVarchar(300)
Description nVarchar(500)
Details nVarchar(max)
Date DateTime
Tags nVarchar(300)
Image varchar(60)
CategoryID int
Updated DateTime
Created DateTime
Published Boolean

Answer Source

Have you tried using REPLACE():

Update BLOG
SET Tags = REPLACE(Tags, ',', N'،')
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download