Microsoft KB Archive/214596

= FIX: Alpha: Access Violations When Executing Query Plans the First Time =

Article ID: 214596

Article Last Modified on 3/14/2006

-

APPLIES TO


 * Microsoft SQL Server 6.5 Standard Edition, when used with:
 * the hardware: DEC Alpha

-



This article was previously published under Q214596



BUG #: 18403; 18404 (SQLBUG_65)



SYMPTOMS
Under very narrow circumstances, the first execution of a query plan (seen mostly with stored procedures, but may also apply to views, and so on) after a restart of SQL Server may cause a handled access violation (AV).

NOTE: This problem only occurs on the Alpha platform; it does not occur on Intel-based processor architectures.

Other items of note include the following:


 * The AV happens on the first execution of certain stored procedures with certain parameters after restarting SQL Server.
 * When running the offending statement recorded by SQL Server's exception handler again, the AV always occurs (that is, it is reproducible).
 * A slight change of the stored procedure or the parameters in the first execution after a restarting the server may cause the AV to disappear until the cached plan is discarded or SQL Server is cycled.



CAUSE
This problem is caused by a bad memory alignment in the procedure cache under very narrow circumstances.



WORKAROUND
To work around this problem, do the following:


 * 1) Call the stored procedure with "safe" parameters in a startup procedure.
 * 2) Call the stored procedure with "safe" parameters on a scheduled basis to avoid the "good execution plan" being flushed from the procedure cache.



STATUS
Microsoft has confirmed this to be a problem in SQL Server 6.5. This problem has been corrected in Service Pack 5a for Microsoft SQL Server 6.5.For more information, click the following article number to view the article in the Microsoft Knowledge Base:

197177 INF: How to Obtain SQL Server 6.5 Service Pack 5a

For more information, contact your primary support provider.

Additional query words: sp sp5 sp5a

Keywords: kbbug kbfix kbqfe KB214596

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.