when i run this query ......

update item set description=(select description from item where itemid=5384);

i get this error message...

Msg 279, Level 16, State 3, Line 1
The text, ntext, and image data types are invalid in this subquery or aggregate expression.

there is a lot of text in the description column of itemid 5384 (html coding) and i need to set all of the records in the table equal to it......

update item set description=(select convert(varchar(600), description from item 
where itemid=5384);

:?:

thanks for the reply.... but i got this error

Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'from'.


the problem may that description is a ntest column

How can you update a table while querying the same table ? I mean, update item set description=(select description from item where itemid=5384); wouldn't work since its trying to update a column by fetching the value from the column of the same table!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.