Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 NULL textptr (text, ntext, or image pointer)

Author  Topic 

blakmk
Starting Member

45 Posts

Posted - 2009-03-24 : 07:53:05
Hi,

I have a table that contains a ntext field which im trying to update. The rest of the columns are populated but this one is null.

Im using this sql to try and update the field:

DECLARE @ptrval binary(16)
SELECT @ptrval = TEXTPTR(sys_solutiondesc)
FROM request
WHERE sys_request_id = 388713
select @ptrval
WRITETEXT request.sys_solutiondesc @ptrval 'blah blah blah'

I then get this error:
Server: Msg 7133, Level 16, State 2, Line 6
NULL textptr (text, ntext, or image pointer) passed to WRITE TEXT function.
The statement has been terminated.

Has anyone else encountered this problem or knows a workaround for this?

It seems like the fact that the record already exists is causing a problem!

Mark

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2009-03-24 : 09:55:24
I suspect this is because your value is NULL to begin with. From Books Online:

quote:
For WRITETEXT to work correctly, the column must already contain a valid text pointer.

Also from Books Online:
quote:

Important:
This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Use the large-value data types and the .WRITE clause of the UPDATE statement instead.



Be One with the Optimizer
TG
Go to Top of Page
   

- Advertisement -