sp_forceonline_object

Description

Provides access to an index previously marked suspect by recovery.

Syntax

sp_forceonline_object dbname, objname, indid,
	{sa_on | sa_off | all_users} [, no_print]

Parameters

dbname

is the name of the database containing the index to be brought online.

objname

is the name of the table.

indid

is the index ID of the suspect index being brought online.

sa_on

allows only users with the sa_role to access the specified index.

sa_off

revokes access privileges created by a previous invocation of sp_forceonline_object with sa_on.

all_users

allows all users to access the specified index.

no_print

skips printing a list of other suspect objects after the specified object is brought online.

Examples

Example 1

Allows a System Administrator to access the index with indid 3 on the titles table in the pubs2 database:

sp_forceonline_object pubs2, titles, 3 , sa_on

Example 2

Revokes access to the index from the System Administrator. Now, no one has access to this index:

sp_forceonline_object pubs2, titles, 3, sa_off

Example 3

Allows all users to access the index on the titles table in the pubs2 database:

sp_forceonline_object pubs2, titles, 3, all_users

Usage

Permissions

Only a System Administrator can execute sp_forceonline_object.

See also

System procedures sp_listsuspect_object, sp_setsuspect_granularity