BUG: Statistics Are Printed Twice with Statistics Time On

ID: Q196916

The information in this article applies to:

BUG #: 37972 (SQLBUG_70)

SYMPTOMS

When you execute a query with statistics time on, you will see the statistics printed in the results window twice.

CAUSE

Auto-parameterization is a new feature in SQL Server 7.0. Using parameters or parameter markers in Transact-SQL statements increases the ability of the relational engine to match new SQL statements with existing, unused execution plans. If an SQL statement is executed without parameters, SQL Server 7.0 parameterizes the statement internally to increase the possibility of matching it against an existing execution plan.

Because the server tries to use Auto-parameterization the query is partially compiled twice. The first time is to parse and Auto-parameterize the query. The second time the query is compiled is when the plan is put into cache.

STATUS

Microsoft has confirmed this to be a problem in SQL Server version 7.0.

Additional query words:

Keywords          : kbbug7.00 
Version           : WINNT:7.0
Platform          : winnt
Issue type        : kbbug
Solution Type     : kbpending

Last Reviewed: December 31, 1998