Home > Enterprise >  Replacing words in a string
Replacing words in a string

Time:01-28

I would like to replace words in a string using mssql. Query:

UPDATE VS_48538  
SET name = REPLACE(name, '%[N]eptun[ ][-]kód%', 'Neptunkód') 
WHERE name LIKE '%[N]eptun[ ][-]kód%'

What I'd like to change is cc neptun -kód dd, (just this part: neptun -kód --> Neptunkód). Replace is not working.

CodePudding user response:

@George Menoutis answered it: replace(name,N'neptun -kód',N'Neptunkód') Thank you!

CodePudding user response:

Oh I've just read the full description.

Then if you're trying to use Replace you need to first define the column which you want to replace.

replace(name,N'neptun -kód',N'Neptunkód')

'%' - this wouldn't work...

  • Related