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

ID: Q209462


The information in this article applies to:
  • Microsoft SQL Server version 6.5

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 version 6.5.

Additional query words: locks ex_table

Keywords : SSrvLock kbSQLServ650bug
Version : winnt:6.5
Platform : winnt
Issue type : kbbug


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