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
 Transact-SQL (2000)
 CHARINDEX Limitation?

Author  Topic 

u4cast
Starting Member

16 Posts

Posted - 2004-03-17 : 06:05:40
Hi,

I'm searching on a text column using CHARINDEX but I can't seem to search beyond the 8000th character in the text? Is this because CHARINDEX is limited to string data types and so converting my text column to varchar(8000) before it searches? If so, is there a way around it? PATINDEX seems to have the same problem.

Here's a line of code that demonstrates the problem:

SELECT CHARINDEX('Sometext', TEXTFIELD) POS FROM TBL_TEST WHERE PAGENO = 142

returns:

POS
-----------
7868

but if I search for somthing a few hundred characters further on in the text on page 142 I get:

POS
-----------
0

This is urgent so any help would be much appreciated although I can't give a prize or anything!

u4cast
Starting Member

16 Posts

Posted - 2004-03-17 : 06:22:50
It is a limitation and I've coded around it now but thanks for reading this anyway.
Go to Top of Page
   

- Advertisement -