Wednesday 18 August 2010

Full-text indexing problems

I ran into a problem recently setting up full-text indexing on a test version of a database, cloned from a production database schema. The initial problem was that the original index was on a drive letter that didn't exist on the target machine. After sorting that out, which involved a little bit of system table manipulation, I then ran into another problem trying to rebuild the indexes. I got as far as a stored procedure call like this:

exec sp_fulltext_table N'[dbo].[credit]', N'create', N'exp_main', N'PK_credit'

which gave:

Server: Msg 2526, Level 16, State 3, Procedure sp_fulltext_table, Line 122
Incorrect DBCC statement. Check the documentation for the correct DBCC syntax and options.


I followed the advice described here:

http://www.eggheadcafe.com/forumarchives/SQLServerfulltext/Aug2005/post23469255.asp

In particular, manually reinstalling the MSSearch / full text search facility as described here:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;827449

... however, it still didn't work.

The issue was resolved when I realised it was something to do with the sp_fulltext_table procedure. In the course of my messing about, it had lost it's "system" attribute - see:

http://www.informit.com/articles/article.aspx?p=25288&seqNum=6

As mentioned here, "DBCC CALLFULLTEXT" needs this to be set to work properly.

Sure enough looking at master.dbo.sysobjects.status for sp_fulltext_table gave
1610612737, which is 0x60000001. This isn't really documented in any detail anywhere, but I found from some more messing about and looking at the source text of the sp_MS_marksystemobject procedure, I found that it actually sets the top two bits in the status field (i.e. 0xC0000000) - so I ran:

sp_MS_marksystemobject 'sp_fulltext_table'

and it all started working.

4 comments:

Anonymous said...

Hey there, I think your site might be having browser compatibility issues.

When I look at your blog site in Chrome, it looks fine but when opening in Internet Explorer, it has some overlapping.
I just wanted to give you a quick heads up! Other then
that, amazing blog!

My webpage: fake people quotes

Anonymous said...

Today, I went to the beach with my children. I found a sea shell and
gave it to my 4 year old daughter and said "You can hear the ocean if you put this to your ear." She placed the shell to her ear and screamed.

There was a hermit crab inside and it pinched her
ear. She never wants to go back! LoL I know this is completely off topic but I had to tell someone!


my web blog: kitchen cabinet

Anonymous said...

Very nice article, totally what I wanted to find.


Also visit my webpage :: healthy waist to height Ratio

Anonymous said...

I have been surfing online more than 4 hours today, yet I never found any
interesting article like yours. It is pretty worth enough
for me. In my view, if all website owners and bloggers made good content as you did,
the internet will be a lot more useful than ever before.


Here is my web site ... height to waist ratio