[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 300
  • Last Modified:

TSQL script for configuring FTI on SQL 2008

I have a requirement to set up FTI for a large number of databases on SQL 2008 R1. the manual config is a chore and I wold really like to batch it and run some commands using sqlcmd. the attached image shows the summary of how pretty much every single database needs to be configured - the only variable is the database name.  Catalog population need to be on saturdays and I suppose the time would represent the second variable. Note the language for the DOCDATA column needs to be just straight 'English'. - see screenshot FTI 1 for the config of this page.

Can anyone write me a script / batch ?

Cheers
Alastair Table columns to select screen shot of final summary page of FTI config
0
icsasoftware_tst
Asked:
icsasoftware_tst
  • 2
  • 2
2 Solutions
 
lcohanDatabase AnalystCommented:
" the attached image shows the summary of how pretty much every single database needs to be configured - the only variable is the database name."
If this is a generic FT configuration why you don't create the script then use msforeachdb to run it like in the article below:

http://wiki.lessthandot.com/index.php/Sp_MSforeachDB

0
 
lcohanDatabase AnalystCommented:
The query below gives you all basic steps that need to be done for a table/column to be full text enabled and catalog populated.

/*      Enable Database for full text */

if DATABASEPROPERTY(db_name(), 'IsFulltextEnabled') = 0
      EXEC sp_fulltext_database 'enable'
GO


/*       Add Unique index on KBArticle */

ALTER TABLE dbo.KBArticle ADD CONSTRAINT IX_KBArticle_FT UNIQUE NONCLUSTERED  (ArticleId) ON [PRIMARY]
GO
 
/*       Create Full text Catalog */
exec sp_fulltext_catalog 'KBFullText', 'create'    
GO
 
/*      Add table to full text catalog */

--Table KBArticle
exec sp_fulltext_table  'KBArticle',  'create',  'KBFullText', 'IX_KBArticle_FT'
GO
exec sp_fulltext_column  'KBArticle',  'Name',  'add'
GO
exec sp_fulltext_column  'KBArticle',  'Description',  'add'
GO

/*      Activate Full Text index */
exec sp_fulltext_table  'KBArticle',  'activate'
GO

/*      Populate catalog */
exec sp_fulltext_catalog  'KBFullText',  'start_full'
GO
0
 
icsasoftware_tstAuthor Commented:
I've requested that this question be deleted for the following reason:

old ticket.
0
 
icsasoftware_tstAuthor Commented:
thanks
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now