Expensive Transact-SQL queries are generated in the back-end instance of SQL Server when you perform a search in SharePoint Server 2007

Article translations Article translations
Article ID: 950437 - View products that this article applies to.
Expand all | Collapse all

On This Page


When you perform a search by using the Contains or Does not contain operators in Microsoft Office SharePoint Server 2007, you experience the following symptoms.

Note You can perform this search from the Advanced Search page by adding a property restriction as a search condition.
  • The search may time out or may take a long time to finish.
  • Performance decreases on the SQL Server computer on which the SharePoint database is located.
For more information about how to monitor the impact of queries in SQL Server, see the following Microsoft Developer Network Web log:


This problem occurs because expensive Transact-SQL queries are generated in this search scenario.


To resolve this problem, install hotfix 950280.

For more information, click the following article number to view the article in the Microsoft Knowledge Base:
950280 Description of the SharePoint Server 2007 hotfix package: March 21, 2008

Hotfix post-installation information

After you install the hotfix, the Advanced Search page does not display the Contains and Does not contain operators under the Search by properties section. This prevents users from creating expensive queries unintentionally.

To specifically enable the Contains and Does not contain operators, follow these steps:
  1. On the Advanced Search page, click Site Actions, and then click Edit Page.
  2. On the Advanced Search Box Web part, click Edit, and then click Modify Shared Web Part.
  3. Expand the Properties tab.
  4. In the Properties text box, locate the following xml entry:
    <Option Name="AllowOpContains" Value="False"/>
    If this entry does not exist, create the following entry:
    <Option Name="AllowOpContains" Value="True"/>
  5. If the entry already exists in step 4, change “False” to “True."

    Note To disable these options, you can change the text back to “False."
  6. Click OK.
  7. Click Publish to publish the page.


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.


Article ID: 950437 - Last Review: December 11, 2008 - Revision: 2.0
  • Microsoft Office SharePoint Server 2007
kboffice2007presp2fix kbexpertiseinter kbqfe kbbug kbfix kbpubtypekc KB950437

Give Feedback


Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com