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 2000 Forums
 SQL Server Development (2000)
 What is the point of a pointer in textptr?

Author  Topic 

Hommer
Aged Yak Warrior

808 Posts

Posted - 2005-10-28 : 14:44:51
I am learning all the fuctions that deal with text data type. One of the samples from BOL lists here. My question is, what exactly is the pointer? I could get the same result from a substring(). I'd guess textptr() will boost the performance. My challenge is to dynamically find the position in the text string. textptr seems provide no help. It always points to the end of the string.

USE pubs
GO
DECLARE @ptrval varbinary(16)
SELECT @ptrval = TEXTPTR(pr_info)
FROM pub_info pr INNER JOIN publishers p
ON pr.pub_id = p.pub_id
AND p.pub_name = 'New Moon Books'
READTEXT pub_info.pr_info @ptrval 1 25
GO

select substring(pr_info, 2, 25)
FROM pub_info pr INNER JOIN publishers p
ON pr.pub_id = p.pub_id
AND p.pub_name = 'New Moon Books'

X002548
Not Just a Number

15586 Posts

Posted - 2005-10-28 : 14:53:26
[d'oh]
Books online perhaps?
[/d'oh]

Text data is not stored on the data pages with the rest of the data. The text pointer shows (I think) the physical location of the data on the disk.



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page
   

- Advertisement -