Unix Technical Forum

Create Index via Stored Procedure?

This is a discussion on Create Index via Stored Procedure? within the SQL Server forums, part of the Microsoft SQL Server category; --> Hi, I am trying to create an index from a stored procedure. The stored procedure runs without error, but ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-29-2008, 03:28 AM
HumanJHawkins
 
Posts: n/a
Default Create Index via Stored Procedure?

Hi,

I am trying to create an index from a stored procedure. The stored procedure
runs without error, but when I try to use "CONTAINS" or "FREETEXT" on the
table, it tells me that I can't because the table is not indexed.

At the point of this code, a table called 'SearchCompareBase' is already
created and full of data. The syntax I am using to index that table follows.
Can anyone help me get it working:

CREATE INDEX SearchCompareBase_Index
ON SearchCompareBase (Word, Definition, POS, Category)

DECLARE @begin datetime
DECLARE @status int

SET @begin = CURRENT_TIMESTAMP
EXEC sp_fulltext_catalog 'SearchCompareBase_Index', 'start_full'

-- Wait for population to complete
SELECT @status = FullTextCatalogProperty('SearchCompareBase_Index',
'populatestatus')
WHILE (@status <> 0)
BEGIN
WAITFOR DELAY '00:00:01'
SELECT @status = FullTextCatalogProperty('SearchCompareBase_Index',
'populatestatus')
END


Thanks in advance for any help!


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:46 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com