SSMS - 删除&符号和字符

SSMS - Removing Ampersand & Characters

如果我 运行 以下内容,& 值将替换为 and

select 
     replace('Difference_between_desired_date_&_generic_window float', '&', 'and') as [col_1]

如果我 运行 以下内容,& 不会被替换,即使我的第一个示例中的相同值在列中(我实际上是从我的第一个示例的列中复制的):

select 
     replace([column_with_my_value], '&', 'and') as [col_2]

这是为什么?

我需要转义 & 字符。

替换为:

select 
     replace([column_with_my_value], '&', 'and') as [col_2]

有了这个:

select 
     replace([column_with_my_value], '\&', 'and') as [col_2]

它工作正常,但我不确定为什么它适用于 1 而不是另一个。