Showing posts with label Replace last occurrence of a string in SQL Server?. Show all posts
Showing posts with label Replace last occurrence of a string in SQL Server?. Show all posts

Replace last occurrence of a string in SQL Server?

Step 1: Create a procedure in order to replace the last occurrence of a string with a specified string as shown below: CREATE PROC sp_ReplaceStringWithLastOccurence (       @Texto varchar(MAX),       @findString VARCHAR(100),       @replaceString VARCHAR(100) ) AS BEGIN     DECLARE @Pos INT=0,@startPos INT=0,@endPos INT=0,@totalStringLength

Read More