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



The information in this article applies to:

  • Microsoft SQL Server 6.5 Service Pack 2 and later

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.


Modification Type:MajorLast Reviewed:10/3/2003
Keywords:kbBug kbpending KB186980