Discussion:
The text, ntext, and image data types are invalid for local variables
(too old to reply)
Denis
2022-07-04 13:13:47 UTC
Permalink
The problem is that we have to move 'image' data from one table to another.
When we try to use a cursor and read the data into variable the error
appears.
If anyone knows another way to move 'image' data between tables then please
reply
Thorir.
Local variables cannot be of text, ntext, or image data type.
Hope this helps.
Hari Ramachandran
Please reply only to newsgroups. When posting, please state the version of
error message text received, if any.
This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
| Subject: The text, ntext, and image data types are invalid for local
variables
| Date: Fri, 29 Mar 2002 09:48:31 -0000
| Lines: 12
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
microsoft.public.access.adp.sqlserver,microsoft.public.sqlserver.programming
| NNTP-Posting-Host: addi.spar.is 193.4.44.40
| Path: cpmsftngxa07!tkmsftngp01!tkmsftngp03
| Xref: cpmsftngxa07 microsoft.public.sqlserver.programming:245635
microsoft.public.access.adp.sqlserver:5459
| X-Tomcat-NG: microsoft.public.sqlserver.programming
|
| Server: Msg 2739, Level 16, State 1, Procedure sp_createunits, Line 0
| The text, ntext, and image data types are invalid for local variables.
|
| Also i need to create a BLOB field
|
| Anyone
|
| Thanks
|
|
|
|
did you guys figure it out in the end?
Erland Sommarskog
2022-07-05 07:48:31 UTC
Permalink
Post by Denis
The problem is that we have to move 'image' data from one table to
another. When we try to use a cursor and read the data into variable
the error appears. If anyone knows another way to move 'image' data
between tables then please reply
did you guys figure it out in the end?
I guess they did. Way back in 2002, this was a difficult problem with
no good workaround. But starting with SQL 2005, the types text, ntext
and image are deprecated, and you should use varchar/nvarchar/varbinary(MAX)
instead. They are first-class citizens, and you can say:

DECLARE @x varbinary(MAX)

Loading...