Thursday, July 28, 2011

Replace a string value with another in SQL Server

select *from sa_Name
update sa_Name set SurName = REPLACE(SurName,'Aravindakshan','A')
select *from sa_Name

Capture

     after executing this query the Name ‘Aravindakshan’ is replaced with ‘ A’ all the occurrence of this word in Surname column should be replaced with ‘A’.

0 comments:

Post a Comment