Microsoft KB Archive/309555

= BUG: Bcp.exe Executes Query Twice When QueryOut Argument Used =

Article ID: 309555

Article Last Modified on 9/25/2003

-

APPLIES TO


 * Microsoft SQL Server 2000 Standard Edition

-



This article was previously published under Q309555



BUG #: 355023 (SHILOH_BUGS)

BUG #: 74204 (MDAC)



SYMPTOMS
Exporting rows from a table by using the bcp utility takes longer than expected when you specify the QueryOut argument to provide selective criteria when retrieving rows.



CAUSE
The query specified in the bcp statement executes twice, which results in twice the amount of Reads and Writes and can double the execution time of the operation.



WORKAROUND
Avoid use of the QueryOut argument when you export rows with the bcp utility. To export selective data, create a view and base it on the original query specified in the bcp operation. Next, use the Out argument instead of the QueryOut argument to bulk-copy the view.



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

Additional query words: kbAudDeveloper kbSQLServ2000

Keywords: kbbug kbpending KB309555

-

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

© Microsoft Corporation. All rights reserved.