BUG: Exclusive Table Lock when Using Insert Select with ORDER BY (209462)



The information in this article applies to:

  • Microsoft SQL Server 6.5

This article was previously published under Q209462
BUG #: 18210 (SQLBUG_65)

SYMPTOMS

An exclusive table lock is inadvertently placed on a table when it is being populated with an INSERT SELECT statement and the SELECT statement contains an ORDER BY clause.

WORKAROUND

To work around this behavior, try one of the following:
  • Modify the SELECT statement so that it does not contain an ORDER BY clause.

    -or-
  • Implement the SELECT statement as a stored procedure and use an INSERT EXECUTE statement to populate the table.

    -or-
  • Populate a temporary table using a SELECT statement that contains the ORDER BY clause. Then use the temporary table in the INSERT SELECT statement.

STATUS

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

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