Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.sqlserver.programming > #31379

Re: The text, ntext, and image data types are invalid for local variables

Path csiph.com!news.mixmin.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From Erland Sommarskog <esquel@sommarskog.se>
Newsgroups microsoft.public.sqlserver.programming
Subject Re: The text, ntext, and image data types are invalid for local variables
Date Tue, 05 Jul 2022 09:48:31 +0200
Organization Erland Sommarskog
Lines 18
Message-ID <XnsAECB63C7B9B30Yazorman@127.0.0.1> (permalink)
References <u2oJJbw1BHA.1976@tkmsftngp03> <sCX2z5n2BHA.2440@cpmsftngxa07> <#nIsLyZ6BHA.2172@tkmsftngp04> <93593b89-6429-4af3-8f56-3fabea17045cn@googlegroups.com>
MIME-Version 1.0
Content-Type text/plain; charset=windows-1252
Content-Transfer-Encoding 8bit
Injection-Info reader01.eternal-september.org; posting-host="32d600c762f4d14289d2c88f28780939"; logging-data="3848627"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19sdxko5KhYxcHF+jeTWyUX"
User-Agent Xnews/2006.08.24 Mime-proxy/2.1.c.0 (Win32)
Cancel-Lock sha1:jAzdvJhNwkTLShsFjX4SSwzZI/c=
Xref csiph.com microsoft.public.sqlserver.programming:31379

Show key headers only | View raw


Denis (korolidenis@gmail.com) writes:
> Il giorno lunedì 22 aprile 2002 alle 03:25:51 UTC+2 Thorir Danielsson ha
> scritto: 
>> 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)

Back to microsoft.public.sqlserver.programming | Previous | NextPrevious in thread | Find similar


Thread

Re: The text, ntext, and image data types are invalid for local variables Denis <korolidenis@gmail.com> - 2022-07-04 06:13 -0700
  Re: The text, ntext, and image data types are invalid for local variables Erland Sommarskog <esquel@sommarskog.se> - 2022-07-05 09:48 +0200

csiph-web