Microsoft KB Archive/188329

= BUG: ORDER BY Queries May Truncate Trailing Spaces of Columns =

Article ID: 188329

Article Last Modified on 10/3/2003

-

APPLIES TO


 * Microsoft SQL Server 6.5 Standard Edition

-



This article was previously published under Q188329



BUG #: 18018 (SQLBUG_65)



SYMPTOMS
If all the following conditions are true, a query that contains an ORDER BY clause will truncate the trailing blanks of the result columns:


 * A table is created with ANSI_PADDING enabled.
 * The table has rows inserted with trailing blanks.
 * A worktable is used by SQL Server to manage the ORDER BY clause.
 * The query contains a column list instead of '*' (all columns).
 * The client running the SELECT statement does not have ANSI_PADDING currently enabled.



WORKAROUND
Use any of the following methods to work around this problem:


 * Enable ANSI_PADDING from all clients. -or-


 * Use SELECT * (all columns in created order) instead of a SELECT statement with a column list on queries that use the ORDER BY clause. -or-


 * Create an index to support the ORDER BY clause instead of having SQL Server use a worktable.



STATUS
Microsoft has confirmed this to be a problem in SQL Server version 6.5. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



MORE INFORMATION
This is not really an issue for ODBC-based clients because the setting ANSI_PADDING is enabled by default.

Additional query words: prodsql work table

Keywords: kbbug kbpending KB188329

-

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

© Microsoft Corporation. All rights reserved.