次の挿入ステートメントを機能させようとしていますが、うまくいきませんでした。色々と調べたり試したりしましたが、解決には至りませんでした。リテラル文字列 NA を列に割り当てる方法はありますか?
qryALL (@pPK BIGINT,@pAL FLOAT,@pFK BIGINT)
AS
DECLARE @query AS NVARCHAR(MAX)
SET @query = 'INSERT INTO tblTPF ( fldFPK, fldPK, fldDTA, fldCI, fldMD, fldME,
fldIQ, fldSD, fldND, fldNI, fldNL, fldMI, fldMA, fldUN, fldAV )
SELECT '+ Convert(varchar,@pFK) +' AS sFPK, '+ Convert(varchar,@pPK) +' AS sPK,
GETDATE() AS sDate, '+ Convert(varchar,@pAL) +' AS sAL, -254 AS sMD, -254 AS sME,
-254 AS sIQ, -254 AS sSD, 0 AS sND, 0 AS sNI, 0 AS sNL, -254 AS sMI, -254 AS sMA,
NA AS sUN, 0 AS sAV;'
execute sp_executesql @query