Why update of Text type column no work?

W

Woody Splawn

I am attempting to update the database with an update command in code. The
backend is a SQL Server database and the field happens to be a Text field, a
field that can hold very large amounts of data. When I do the update I get
the following error:

"The query processor could not produce a query plan from the optimizer
because a query can not update a text, nText, or image column or a
clustering key at the same time"

Can someone tell me what I can do to make this work?
 
K

Kevin Sun [MS]

Hi

You can use UPDATETEXT and WRITETEXT to update a text field in SQL
database.

Examples
This example puts the text pointer into the local variable @ptrval, and
then uses UPDATETEXT to update a spelling error.

USE pubs
GO
EXEC sp_dboption 'pubs', 'select into/bulkcopy', 'true'
GO
DECLARE @ptrval binary(16)
SELECT @ptrval = TEXTPTR(pr_info)
FROM pub_info pr, publishers p
WHERE p.pub_id = pr.pub_id
AND p.pub_name = 'New Moon Books'
UPDATETEXT pub_info.pr_info @ptrval 88 1 'b'
GO
EXEC sp_dboption 'pubs', 'select into/bulkcopy', 'false'
GO
================

For more information, please refer to the SQL Book online


Sincerely,

Kevin
Microsoft Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! - www.microsoft.com/security

--------------------
| From: "Woody Splawn" <[email protected]>
| Subject: Why update of Text type column no work?
| Date: Fri, 19 Sep 2003 14:13:09 -0700
| Lines: 13
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <#[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.adonet
| NNTP-Posting-Host: 168.158-60-66-fuji-dsl.static.surewest.net
66.60.158.168
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:61682
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
| I am attempting to update the database with an update command in code.
The
| backend is a SQL Server database and the field happens to be a Text
field, a
| field that can hold very large amounts of data. When I do the update I
get
| the following error:
|
| "The query processor could not produce a query plan from the optimizer
| because a query can not update a text, nText, or image column or a
| clustering key at the same time"
|
| Can someone tell me what I can do to make this work?
|
|
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top