You can try something like this here:
USE [MyDatabase]
GO
declare test cursor for select PK from TableIWishToShread
open test
declare @PK int
declare @content varchar(max)
fetch next from test into @PK
while @@fetch_status=0
begin
select @content=TextData from TableIWishToShread where PK=@PK
insert into tblwords (word)
select *from dbo.ShredMe(@content)
where name not in (select word from tblwords)
fetch next from test into @PK
end
close test
deallocate test
the below script is used to build the inverted file index.
CREATE TABLE tblWordList(SubdocumentID int, WordID int, Position int)
Create table tblWords(WordID int not null identity primary key, Word
varchar(max),Little int)
Here is shredme:
USE [SonarProd]
GO
/****** Object: UserDefinedFunction [dbo].[ShredMe] Script Date: 09/05/2007
14:40:40 ******/
CREATE FUNCTION [dbo].[ShredMe](@postDescription [nvarchar](max))
RETURNS TABLE (
[Name] [nvarchar](200) NULL
) WITH EXECUTE AS CALLER
AS
EXTERNAL NAME [GoldShredder].[UserDefinedFunctions].[ShredMe]
GO
EXEC sys.sp_addextendedproperty @name=N'AutoDeployed', @value=N'yes' ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'FUNCTION',@level1name=N'ShredMe'
GO
EXEC sys.sp_addextendedproperty @name=N'SqlAssemblyFile',
@value=N'ShredMe.cs' , @level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'FUNCTION',@level1name=N'ShredMe'
GO
EXEC sys.sp_addextendedproperty @name=N'SqlAssemblyFileLine', @value=22 ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'FUNCTION',@level1name=N'ShredMe'
Here is the assembly. http://www.indexserverfaq.com/goldshredder.dll

Signature
RelevantNoise.com - dedicated to mining blogs for business intelligence.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
> Is there a way to get the Index keywords list?
>
[quoted text clipped - 4 lines]
> frequency. The user selected on or many keywords from the ListBox
> then launch the search.
Carignan - 06 Sep 2007 18:32 GMT
Great tks alot
but when i run the CREATE FUNCTION....
i'm getting this:
Msg 6208, Level 16, State 1, Procedure ShredMe, Line 1
CREATE FUNCTION failed because the parameter count for the FillRow
method should be one more than the SQL declaration for the table
valued CLR function.
> You can try something like this here:
>
[quoted text clipped - 79 lines]
> > frequency. The user selected on or many keywords from the ListBox
> > then launch the search.