Sql-server – fulltext_stoplists to database_principals issue

dbccsql serversql-server-2016ssmssystem-tables

When I run a DBCC check against the database, it informs me that there is an issue with the sys.fulltext_stoplists object. It appears that the principal_id in stoplists does not have a relationship with database_principals:

Query result

What would be the best way to address the issue? It is difficult to modify data in system tables.

Best Answer

The sys.fulltext_stoplists doc says the column principal_id is the ID of the database principal that owns the stoplist. You can specify it as one of the Arguments of the CREATE FULLTEXT STOPLIST command:

AUTHORIZATION owner_name
Specifies the name of a database principal to own of the stoplist. owner_name must either be the name of a principal of which the current user is a member, or the current user must have IMPERSONATE permission on owner_name. If not specified, ownership is given to the current user.

It appears the owner of the object no longer exists. You can assign a new owner using the ALTER AUTHORIZATION like this:

ALTER AUTHORIZATION ON FULLTEXT STOPLIST::CustomStopword TO SomeExistingUser;

After that, run the DBCC check again to see if everything is ok.