簡體   English   中英

BCP 錯誤:只有在復制到服務器時才能跳過列

[英]BCP Error: columns may be skipped only when copying into the Server

當我發出此命令時(看起來很傻但確實有效):

BCP "declare @colnames varchar(max); select @colnames=coalesce (@colnames+char(9), '') 
+ Column_Name from db.information_Schema.columns where table_name='table1' order by 
ordinal_position; select @colnames" 
     queryout Table1_Columns.tsv -S?? -U?? -P?? -f** -e**

我收到此錯誤:

[Microsoft][SQL Native Client]Host-file 列只有在復制到服務器時才能跳過

格式文件為:

9.0
1
1 SQLCHAR 0 100 "\r\n" 1 Column_Names SQL_Latin1_General_CP1_CI_AS

有人能告訴我為什么我會收到這個錯誤嗎?

有一個活躍的錯誤報告: http : //connect.microsoft.com/SQLServer/feedback/details/584001/bcp-table-out-with-format-file-does-not-work-if-file-specifying-列數少於源表

一種簡單的解決方法是將變量寫入臨時表(不是#temptable,而是臨時表),然后bcp從中輸出。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM