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

ID: Q186980


The information in this article applies to:
  • Microsoft SQL Server version 6.5 Service Pack 2 and later

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 : SSrvStProc SSrvTran_SQL kbbug6.50
Version : WinNT:6.5
Platform :
Issue type : kbbug


Last Reviewed: April 21, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.