0

This is a table in a Microft Dynamics 2009 database. Our Test database is missing a bunch of Image data, so I would like to update the table in test with the data in production. I'm using this SQL for this update. When I execute this, I get this error:

Msg 8180, Level 16, State 1, Line 1
Statement(s) could not be prepared.
Msg 306, Level 16, State 2, Line 1
The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.

Query:

UPDATE INVENTTABLE 
SET
    Z_IMAGE = i2.Z_IMAGE,
    Z_IMAGEMIMETYPE = i2.Z_IMAGEMIMETYPE
FROM INVENTTABLE i1
    JOIN [PRODSQLSERVER].[DAX2009DB].[dbo].INVENTTABLE i2
        ON i1.RECID = i2.RECID
WHERE i2.Z_IMAGE IS NOT NULL

I can't see a place where I'm attempting to compare or sort the Image data.

4

1 回答 1

0

Try changing UPDATE INVENTTABLE to UPDATE i1.

于 2013-11-12T15:31:34.533 回答