Home Forums SQL Server 2005 T-SQL (SS2K5) Tricky REPLACE problem RE: Tricky REPLACE problem
Tom257
SSChampion
Points: 11543
More actions
September 7, 2012 at 1:47 pm
#1535267
replace the untouchable 'BA#' first, then do the main replace, then put the 'BA#' back
SELECT REPLACE(REPLACE(REPLACE(@STRING, 'BA#', '***'), 'A#', 'C#'), '***', 'BA#')