Replace a string with another string

Submitted by:Jhon Jhon

Date added:01 February, 2014

Category:MySQL

This stored sql procedure is used to replace a special character (or string) of your field with another string.

Tags: replace string , replace character

Code Snippet:

CREATE PROCEDURE [dbo].[cO_ReplaceFieldValue] (@value NVARCHAR(2000) OUTPUT, @fieldValue varchar(200),@toReplace varchar(200),@replaceWith varchar(200))
AS
BEGIN
SET @value = null
select @value = ISNULL(REPLACE(@fieldValue, @toReplace, @replaceWith), '')
RETURN
END
 
 

Comments