Microsoft KB Archive/209462

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

Article ID: 209462

Article Last Modified on 10/3/2003

-

APPLIES TO


 * Microsoft SQL Server 6.5 Standard Edition

-



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.

Additional query words: locks ex_table

Keywords: kbbug kbpending KB209462

-

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

© Microsoft Corporation. All rights reserved.