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)
 FTS Issue on varchar(MAX) or Text data type column

Author  Topic 

eric33
Starting Member

4 Posts

Posted - 2007-08-15 : 15:11:22
I am attempting to use FTS to search a data column that could potentially be quite large. I get no results when I search on a data column that is of type nvarchar(MAX), varchar(MAX) or Text, however if I change the same data column to varchar(8000) or lower I have no problems.

I was under the impression that FTS supported the above data types, but I can't seem to get them to work.

Does anyone have any suggestions on how to return FTS results from these data types?

eric33
Starting Member

4 Posts

Posted - 2007-08-15 : 16:49:08
To more illustrate my problem...

For instance this works, and will return all applicable results.

CREATE TABLE [dbo].[TestHtml](
[ID] [int] IDENTITY(1,1) NOT NULL,
[PageText] [varchar](1000) NOT NULL,
CONSTRAINT [PK_TestHtml] PRIMARY KEY CLUSTERED

SELECT * FROM TestHTML WHERE Contains(PageText, @searchterm);


And this does not. It returns zero results what so ever.

CREATE TABLE [dbo].[TestHtml](
[ID] [int] IDENTITY(1,1) NOT NULL,
[PageText] [varchar](MAX) NOT NULL,
CONSTRAINT [PK_TestHtml] PRIMARY KEY CLUSTERED

SELECT * FROM TestHTML WHERE Contains(PageText, @searchterm);

Could someone please tell me what I need to do to enable FTS on varchar(MAX) or Text columns?
Go to Top of Page

eric33
Starting Member

4 Posts

Posted - 2007-08-15 : 17:09:05
Nevermind... I fixed it. The problem was that I had a primary key associated with my table and that caused it not to work.
Go to Top of Page
   

- Advertisement -