Specifying Multiple Columns When Creating a Text Index

When you create a text index on two or more columns, each column in the text index is placed into its own document zone. The name of the zone is the name of the column. For example, to create a text index and an index table named i_blurbs for both the copy column and the au_id column in the blurbs table in pubs2 on KRAZYKAT, enter:

sp_create_text_index "KRAZYKAT", "i_blurbs", "blurbs", " ", "copy", "au_id"

sp_create_text_index creates two zones in the text index named “copy” and “au_id.” When you issue a query against the i_blurbs text index, the search includes the copy and au_id columns. However, you can limit your search to a particular column by using the in operator to specify a document zone (for more information, see “in”).