solving sql server problems for millions of dbas and developers since 2006



SQL Server DBA Tips SQL Server Developer Tips SQL Server Business Intelligence Tips SQL Server Career Tips SQL Server Tip Categories SQL Server Tutorials SQL Server Webcasts SQL Server Whitepapers SQL Server Tools SQL Server Questions and Answers MSSQLTips Authors About MSSQLTips SQL Server User Groups MSSLQTips Giveaways MSSQLTips Advertising Options

MSSQLTips Facebook Page MSSQLTips LinkedIn Page MSSQLTips RSS Feed MSSQLTips Twitter Page MSSQLTips Google+ Page








SQL Server Full Text Catalogs Stored Procedures

By: | Read Comments | Print

Edgewood Solutions is a technology company focused on Microsoft SQL Server and founder of MSSQLTips.com.

Related Tips: More

Problem
As mentioned in a previous tip, there are a number of locations where full-text search information can be found in SQL Server 2000 and SQL Server 2005. SQL Server 2005 includes some dynamic management views, but in SQL Server 2000 there are no such views, requiring creation of your own statements or views to gather the information.

Solution
There are stored procedures in each database that can assist you in gathering information you need to document or work with full-text catalogs already present in your environment. As with other stored procedures that provide information on objects in SQL Server, these stored procedures start with "sp_help". The following table shows those stored procedures, their purpose, and information provided by the stored procedure:

sp_help_fulltext_catalogs
Must be run in the database in which it resides
USE adventureworks2000
GO

exec sp_help_fulltext_catalogs @fulltext_catalog_name = 'ctgDocumentSummary'

ftcatid The ID of the full-text catalog
Name The name of the full-text catalog
Path The physical location of the Gatherer Project folder
Status The current status of the catalog:
0 = Idle
1 = Full population in progress
2 = Paused
3 = Throttled
4 = Recovering
5 = Shutdown
6 = Incremental population in progress
7 = Building index
8 = Disk is full. Paused
9 = Change tracking
Number_FullText_Tables The number of tables associated with the catalog
sp_help_fulltext_catalogs_cursor
Must be run in the database in which it resides
USE adventureworks2000
GO

DECLARE @mycursor CURSOR
EXEC sp_help_fulltext_catalogs_cursor @mycursor OUTPUT, 'ctgDocumentSummary'
FETCH NEXT FROM @mycursor
WHILE (@@FETCH_STATUS <> -1)
BEGIN
FETCH NEXT FROM @mycursor
END
CLOSE @mycursor
DEALLOCATE @mycursor
GO

ftcatid The ID of the full-text catalog
Name The name of the full-text catalog
Path The physical location of the Gatherer Project folder
Status The current status of the catalog:
0 = Idle
1 = Full population in progress
2 = Paused
3 = Throttled
4 = Recovering
5 = Shutdown
6 = Incremental population in progress
7 = Building index
8 = Disk is full. Paused
9 = Change tracking
Number_FullText_Tables The number of tables associated with the catalog
sp_help_fulltext_columns
Must be run in the database in which it resides
USE adventureworks2000
GO

exec sp_help_fulltext_columns @table_name = 'Document' (optional: @column_name = 'column_name')

TABLE_OWNER The owner of the table
TABLE_ID ID of the table
TABLE_NAME The name of the table
FULLTEXT_COLID The ID of the column (from the table itself)
FULLTEXT_COLUMN_NAME Column of the table that specifies the document type (applicable only when data type is image)
FULLTEXT_BLOBTP_COLNAME The name of the column specifying the document type
FULLTEXT_BLOBTP_COLID The ID of the document type column (from the table itself)
FULLTEXT_LANGUAGE The language used for the full-text search of the column (expressed as a local identifier)
sp_help_fulltext_columns_cursor
Must be run in the database in which it resides
USE adventureworks2000
GO

DECLARE @mycursor CURSOR
EXEC sp_help_fulltext_columns_cursor @mycursor OUTPUT
FETCH NEXT FROM @mycursor
WHILE (@@FETCH_STATUS <> -1)
BEGIN
FETCH NEXT FROM @mycursor
END
CLOSE @mycursor
DEALLOCATE @mycursor
GO

TABLE_OWNER The owner of the table
TABLE_ID ID of the table
TABLE_NAME The name of the table
FULLTEXT_COLID The ID of the column (from the table itself)
FULLTEXT_COLUMN_NAME Column of the table that specifies the document type (applicable only when data type is image)
FULLTEXT_BLOBTP_COLNAME The name of the column specifying the document type
FULLTEXT_BLOBTP_COLID The ID of the document type column (from the table itself)
FULLTEXT_LANGUAGE  The language used for the full-text search of the column (expressed as a local identifier)
sp_help_fulltext_tables
Must be run in the database in which it resides
USE adventureworks2000
GO

exec sp_help_fulltext_tables @fulltext_catalog_name = 'ctgDocumentSummary'

TABLE_OWNER The owner of the table
TABLE_NAME The name of the table associated with the full-text catalog
FULLTEXT_KEY_INDEX_NAME The name of the unique index in the table
FULLTEXT_KEY_COLID The ID of the column associated with the unique index
FULLTEXT_INDEX_ACTIVE Specifies whether the columns associated with the full-text index are eligible for queries
FULLTEXT_CATALOG_NAME The name of the full-text catalog
sp_help_fulltext_tables_cursor
Must be run in the database in which it resides
USE AdventureWorks2000
GO

DECLARE @mycursor CURSOR
EXEC sp_help_fulltext_tables_cursor @mycursor OUTPUT, 'ctgDocumentSummary'
FETCH NEXT FROM @mycursor
WHILE (@@FETCH_STATUS <> -1)
BEGIN
FETCH NEXT FROM @mycursor
END
CLOSE @mycursor
DEALLOCATE @mycursor
GO

TABLE_OWNER The owner of the table
TABLE_NAME  The name of the table associated with the full-text catalog
FULLTEXT_KEY_INDEX_NAME The name of the unique index in the table
FULLTEXT_KEY_COLID The ID of the column associated with the unique index
FULLTEXT_INDEX_ACTIVE Specifies whether the columns associated with the full-text index are eligible for queries
FULLTEXT_CATALOG_NAME The name of the full-text catalog

Next Steps



Related Tips: More | Become a paid author


Last Update: 2/28/2007

Share: Share 






Comments and Feedback:


Post a Comment or Question

Keep it clean and stay on the subject or we may delete your comment.
Your email address is not published. Required fields are marked with an asterisk (*)

*Name   *Email   Notify for updates
Comments
*Enter Code refresh code


 
Sponsor Information
"SQL doctor ROCKS! As soon as I ran it, problems that have been giving me headaches were identified and cured."

The 10 tools in the SQL Developer Bundle cut the time spent in dull and tedious tasks. Learn more.

Need SQL Server help and not sure where to turn? Reach out to expert consultants for a Health Check.

Find and Fix SQL issues with Foglight Performance Analysis. Get a free copy.

Solving SQL Server problems for millions of DBAs and Devs since 2006. Join now.

Learn SQL Server 2012, Performance Tuning, Development, Administration, Replication and more - free webcasts


Copyright (c) 2006-2012 Edgewood Solutions, LLC All rights reserved
privacy | disclaimer | copyright | advertise | about
authors | contribute | feedback | giveaways | user groups
Some names and products listed are the registered trademarks of their respective owners.


Edgewood Solutions LLC | MSSharePointTips.com | MSSQLTips.com