関数 (usr.udf_overpunch) を使用して特殊文字を数値に変換するクエリを作成しています。関数の入力データに使用されるパラメータ @incomming として col4 の結果を設定するにはどうすればよいですか?
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