MarkButler
Programmer
Why does the following insert statement produce the error that follows the code.
Error:
The line in red is the one actually causing the error message. If I change it to "'Claim:'," it works.
TIA
Code:
INSERT INTO diary
(
di_user, di_type, di_task_dt, di_subject,
di_rem_fl, di_sta_cd, di_sta_dt, di_notes,
di_dest_pk, di_dest_fm
)
SELECT
froi.fr_efroi,
'A',
dbo.fn_business_days(froi.fr_mco_dt, 3),
'FROI received on ' + CONVERT(VARCHAR(8), froi.fr_mco_dt, 1) + ' is still in new status.',
'N',
'OP',
GETDATE(),
[COLOR=red]'Claim: '+froi.fr_claimno,[/color]
froi.fr_mco_itn,
'FROI'
FROM
froi
LEFT JOIN diary
ON LEFT(diary.di_dest_pk,20) = froi.fr_mco_itn
WHERE
diary.di_dest_pk IS NULL AND
froi.fr_edi_sta = 'N' AND
froi.fr_mco_dt < @a_date
Error:
Code:
Server: Msg 8626, Level 16, State 1, Line 10
Only text pointers are allowed in work tables, never text, ntext, or image columns. The query processor produced a query plan that required a text, ntext, or image column in a work table.
The line in red is the one actually causing the error message. If I change it to "'Claim:'," it works.
TIA