Replace function in SQL
Mar 5
Today I've found how Replace function is useful in SQL. Because I need to update all columns of every table in our database. Using Replace is very simple.
2columnText = REPLACE (columnText, 'StringToFind', 'StringToReplace')
Above query is correct for nvarchar field but when I'm trying to replace for ntext and text field, it's getting error that "replace isn't ok for text field". That's why I'm goggling and found nice example as follow.
2REPLACE(SUBSTRING(columnText, 1, DATALENGTH(columnText)), 'StringToFind','StringToReplace')

Android
Top of Page