我正在创建一个使用函数 (usr.udf_overpunch) 将特殊字符转换为数值的查询。如何将 col4 的结果设置为用于函数中输入数据的参数 @incomming?
declare @incomming nvarchar(15)
drop table #tempgb
SELECT *
into #tempgb
FROM [AdhocTeamC].[dbo].[R0530135.RPT.SPON_INVOICE]
where substring(col1, 1,5) = 'TPAMT'
select col1,
substring(col1, 1,5) as col2,
substring(col1, 38,5) as col3,
@incomming = substring(col1, 78,14) as col4,
[usr].[Udf_OverPunch] (@incomming) as Overpunch
from #tempgb