BUG: Complex Query Containing Redundant Logic May Cause Access ViolationID: Q232926
|
A complex query that includes logically redundant code may cause a handled access violation (AV) when the Query Optimizer attempts to remove the unnecessary logic at compile time.
A supported fix that corrects this problem is now available from Microsoft, but
it has not been fully regression tested and should be applied only to systems
experiencing this specific problem. If you are not severely affected by this
specific problem, Microsoft recommends that you wait for the next SQL Server service pack
that contains this fix.
To resolve this problem immediately, contact Microsoft Product Support Services
to obtain the fix. For a complete list of Microsoft Product Support Services
phone numbers and information on support costs, please go to the following
address on the World Wide Web:
http://www.microsoft.com/support/supportnet/overview/overview.aspThe English version of this fix should have the following file attributes or later:
Version Size File name Platform
------------------------------------------------
7.00.0661 86,288 Impprov.dll (Intel)
7.00.0661 4,976,912 Sqlservr.exe (Intel)
7.00.0661 116,736 Impprov.dll (Alpha)
7.00.0661 11,801,872 Sqlservr.exe (Alpha)
NOTE: Due to file dependencies, the most recent hotfix or feature that contains the above files may also contain additional files.Q154871 Determining If You Are Eligible for No-Charge Technical Support
To work around this problem, avoid using logical redundancy in complex SQL queries.
Microsoft has confirmed this to be a problem in SQL Server version 7.0.
For example, the following query can be said to contain logically redundant code:
select stor_id, isnull(isnull(qty,0),0) quantity
from pubs..sales
where ord_num = 'P3087a'
The outer ISNULL() function is unnecessary because the nested ISNULL() will never return NULL. In fact, neither ISNULL() function is necessary because the qty column of the sales table does not permit NULL values.
Additional query words:
Keywords : SSrvGPF kbbug7.00
Version : winnt:7.0
Platform : winnt
Issue type : kbbug
Last Reviewed: July 2, 1999