开发者

how to replace text in a particular column on a table in sqlserver

开发者 https://www.devze.com 2023-02-13 21:43 出处:网络
I have an table Employee, with a Description column. In the description column I have the text <br />. Now I need to replace this text with the text <br&开发者_StackOverflow社区gt;.

I have an table Employee, with a Description column. In the description column I have the text <br />. Now I need to replace this text with the text <br&开发者_StackOverflow社区gt;.

Is there any way that i could modify the value in the column itself?


Update Employee
Set Description = Replace(Description , '<br />','<br>')
Where IDColumn = RecordIdValue

You can omit the where clause if you want to update ALL rows in the table.


Use the REPLACE function with a UPDATE statement:

UPDATE EMployee
SET Description = REPLACE(Description, 'find this text', 'replacement')
0

精彩评论

暂无评论...
验证码 换一张
取 消