bcp out在导出到数据文件时是否保持行顺序?

Thu*_*shy 5 bcp sql-server-2005

我需要将数据导出到一个巨大的表中的文件,只有一列但数千行,其中行的排序很重要.我正在使用下面的bcp命令
bcp DBNAME.dbo.tblName out mydata.dat -Uusername -Ppassword -c
我检查了10行的表,我看到行的顺序保存在数据文件中.但是,如果行数超过10000,我可以假设bcp会保持顺序吗?

dav*_*vek 7

我想如果你ORDER BY在你的bcp命令中使用sql语句(with ):

http://www.sqlteam.com/article/exporting-data-programatically-with-bcp-and-xp_cmdshell

他们有以下示例:

SET @bcpCommand = 'bcp "SELECT * FROM pubs..authors 
   ORDER BY au_lname" queryout "' 
Run Code Online (Sandbox Code Playgroud)