Showing posts with label stored procedures. Show all posts
Showing posts with label stored procedures. Show all posts

Wednesday, October 10, 2007

Handy-Dandy Full Text Index Stored Procedures

One of the host I use has SQL Server 2000 databases, but the Full Text Index management features through Enterprise Manager are disabled, so I have to do all my Full Text Index stuff through Query Analyzer.

Here are the stored procedures you can use to create, add tables too, and populate the index.

Handy-dany system stored procedures for setting up a full text index on SQL Server 2000:

Enable full text indexing on the database:
EXEC sp_fulltext_database  'enable'
Create a full text catalog
EXEC sp_fulltext_catalog   'FullTextCatalogName','create'
Enable full text index on a table
EXEC sp_fulltext_table 'TableName', 'create', 'FullTextCatalogName', 'PK_TableName'
Add a column to the Full Text Catalog
EXEC sp_fulltext_column    'TableName', 'ColumnName', 'add'
Activate the index
EXEC sp_fulltext_table     'TableName','activate'
Start full population
EXEC sp_fulltext_catalog   'FullTextCatalogName', 'start_full'
Set Change tracking with the Background option
EXEC sp_fulltext_table 'TableName', 'Start_change_tracking'
EXEC sp_fulltext_table 'TableName', 'Start_background_updateindex'
Note: Change tracking does not track any WRITETEXT or UPDATETEXT operations.

Tuesday, May 22, 2007

Tuesday, March 27, 2007

Changing Table Owner in SQL Server

Something I do upon occassion, but not so often that I can remember it.

To change the owner of a table in SQL Server, open query analyzer, make sure you are in the database containing the table whose owner you want to change, and execute the following stored procedure:

sp_changeobjectowner 'TableName' , 'OwnerName'

Where:
TableName is the name of the table
OwnerName is the name of the account you want to assign ownership to

You can actually use this to change the ownership of any object in the database....