We can use REPLACE function in Sql Server to replace specified text in a string.
declare @myString varchar(100)='My country is India'
set @myString=REPLACE(@myString,'India','Sri lanka')
select @myString as 'Final_Text'
REPLACE() function has three parameters specified.
Original string, text to be replaced, text to be replaced with
Out put:
My country is Sri lanka
Wednesday, December 12, 2012
Replace Text in Sql Server
Subscribe to:
Post Comments (Atom)
No comments:
Write comments