INSERT INTO table containing TEXT column
Posted on 2012-09-17
I have a SQL Table (SQL 2008) which contains a TEXT column. Stuck with it. Purchased package.
I need to INSERT a row to the table using TSQL (ultimately will become a trigger but for now cannot get it to work even as ascript).
Cannot set the local Variable as TEXT as I get the error:
Msg 2739, Level 16, State 1, Line 149
The text, ntext, and image data types are invalid for local variables.
If I set the local variable as VARCHAR(MAX) I get:
Msg 402, Level 16, State 1, Line 107
The data types text and varchar(max) are incompatible in the equal to operator.
Also tried CAST (just for fun) and that didnt work either.
This should be simpler and I'm surprised I've never run across it before.
Any help appreciated.