我有这个问题要问你,为什么这会给我与原始相同字段“Ohio”中的原始值的更新值......现在在 proc“Ohio OH”之后我只想要更新的值。Th 函数只返回我在 proc 中使用它之前测试了一个值。提前感谢您调查它。
CREATE PROC [dbo].[Changestringstate]
AS
UPDATE stage.statetable
SET originalstatename = Rtrim(originalstatename) --avoiding trailing space issues
UPDATE stage.statetable
SET originalstatename = Replace(originalstatename,
Substring (originalstatename,
Len (originalstatename) - (
Charindex(' ', Reverse(
originalstatename)) ) + 1, Len(originalstatename)
),
dbo.Changefunction(originalstatename))