O'Reilly logo

Microsoft® SQL Server™ 2005 Administrator's Companion by Victor Isakov, Stacia Misner, Burzin Patel, Marcilina Garcia, Edward Whalen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Plan Guides

As we’ve seen so far, hints provide a powerful option for influencing the behavior of the SQL Sever database engine and, in a way, give you almost full control over how a query is executed. While a powerful option, the hints are of little use for queries originating in applications which you do not have the code and therefore cannot modify the query to add the hints. For example, you could have the following query that originates in a third-party CRM application and exhibits poor performance due to an incorrect selection of the join type by the optimizer:

SELECT pc.ContactID, FirstName, LastName, EmailAddress, CreditCardID
FROM Person.Contact pc, Sales.ContactCreditCard ccc
WHERE pc.ContactID = ccc.ContactID
AND pc.ContactID < 15;

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required