how to replace text in a particular column on a table in sqlserver
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')
精彩评论