Path: csiph.com!news.mixmin.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Erland Sommarskog 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: References: <#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 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)