FIX: Error 913 May Occur on a SELECT from a Linked Server That Uses a Check Constraint That References a User-Defined Function (316541)



The information in this article applies to:

  • Microsoft SQL Server 2000 (all editions)

This article was previously published under Q316541
BUG #: 356489 (SHILOH_BUGS)

SYMPTOMS

A SELECT statement may return a 913 error if all of the following conditions are met:
  • A query references a remote table through a linked server, and there is a check constraint defined on the column that the query selects.

  • The check constraints calls a user-defined function.

  • A column value is passed as a parameter to the user-defined function.
The error message that you receive is:
Server: Msg 913, Level 16, State 8, Line 1
Could not find database ID 101. Database may not be activated yet or may be in transition.

RESOLUTION

To resolve this problem, obtain the latest service pack for Microsoft SQL Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

290211 INF: How To Obtain the Latest SQL Server 2000 Service Pack

NOTE: The following hotfix was created before the release of Microsoft SQL Server 2000 Service Pack 3.

The English version of this fix should have the following file attributes or later:
   Version       File name        Description
   ------------------------------------------------

   8.00.0566     Sqlservr.exe     SP2-based hotfix
				
NOTE: Because of file dependencies, the most recent hotfix or feature that contains the files may also contain additional files.


WORKAROUND

To work around this behavior, use an OPENQUERY function to run a SELECT statement on the remote server instead of using a four part name query. For example, if your original query is:
SELECT au_id FROM lnksrv.pubs.dbo.authors
				
To avoid the problem, you can use a query similar to this:
SELECT * FROM OPENQUERY (lnksrv, 'SELECT au_id FROM pubs.dbo.authors')
				

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
This problem was first corrected in Microsoft SQL Server 2000 Service Pack 3.

Modification Type:MinorLast Reviewed:9/27/2005
Keywords:kbHotfixServer kbQFE kbbug kbfix kbSQLServ2000preSP3fix kbSQLServ2000sp3fix KB316541