Microsoft KB Archive/186980

= BUG: Handled AV Running INSERT EXEC and Selecting from Empty View =

Article ID: 186980

Article Last Modified on 10/3/2003

-

APPLIES TO


 * Microsoft SQL Server 6.5 Service Pack 2

-



This article was previously published under Q186980



BUG #: 18033 (SQLBUG_65)



SYMPTOMS
A handled access violation (AV) may occur in SQL Server when the following criteria are met:


 * An INSERT INTO ... EXECUTE statement is executed.

-and-
 * The stored procedure selects from a view.

-and-
 * The view performs a SELECT DISTINCT and produces an empty result set.



WORKAROUND
To work around the problem, do either of the following:


 * Ensure that the view does not return an empty result set from a SELECT DISTINCT.

-or-
 * Use a stored procedure (instead of using a view) to select the data into the table before running the INSERT EXECUTE statement.



STATUS
Microsoft has confirmed this to be a problem in Microsoft SQL Server version 6.5 Service Pack 2 and later. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

Additional query words: prodsql

Keywords: kbbug kbpending KB186980

-

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

© Microsoft Corporation. All rights reserved.