与 2008 相比,BCP 命令在 SQL Server 2005 中给出不同的输出?

发布于 2024-08-20 06:01:42 字数 494 浏览 5 评论 0原文

我已在具有相同数据的两个不同设置上执行了两个相同的 bcp 命令。

计算机 A = 运行 SQL Server 2008 的 Windows Vista 计算机

计算机 B = 运行 SQL Server 2005 的 Windows Server 2003 计算机

bcp 命令的输出文本文件不同!首先,机器 B 没有将列名添加到文本文件的开头,并且换行符似乎是错误的。每行应该用换行符分隔,而不是看起来好像在两个字段之后添加换行符?!

bcp 命令是这样的:

bcp DBn_Mitor..TI40 out C:\prepTI4O.txt -c -T -t"\",\"" -r"\"\n\"" -S SQLServer01 -E

这是怎么回事? SQL Server 2005 和 2008 中有何不同导致 bcp 的工作方式不同?

I have executed two identical bcp commands on two different setups with the same data.

Machine A = Windows Vista machine which is running SQL Server 2008

Machine B = Windows Server 2003 machine running SQL Server 2005

The output text file of the bcp command is different! For a start, Machine B does not add column names to the beginning of the text file and it seems to get line breaks wrong. Each row should be separated by line breaks instead it seems as if its putting in line breaks after two fields?!

The bcp command is this:

bcp DBn_Mitor..TI40 out C:\prepTI4O.txt -c -T -t"\",\"" -r"\"\n\"" -S SQLServer01 -E

What is going on here? What is different in SQL Server 2005 and 2008 that will make bcp work differently?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

忘东忘西忘不掉你 2024-08-27 06:01:42

BCP是一个SQL工具,我相信2008年确实有一个不同的版本。我认为如果您使用 BCP 在版本之间导出/导入,您应该使用 RAW 而不是 Native。

从 Access 到 SQL,最好的选择是使用格式文件 - 详细信息可以在 MSDN 上找到。

http://msdn.microsoft.com/en-us/library/ms162802。 ASPX

BCP is a SQL tool ,2008 does come with a different version I believe. I think if you are using BCP to export/import between versions you should use RAW and not Native.

From Access to SQL, the best option is to use a format file - details of this can be found on MSDN.

http://msdn.microsoft.com/en-us/library/ms162802.aspx

独闯女儿国 2024-08-27 06:01:42

服务器是否升级过,或者是否安装了其他 DBMS 工具? AKA,您运行的是正确的 bcp.exe 吗?

我以前见过这样的情况,在 %PATH% 变量中查找时发现的“bcp.exe”不是您期望运行的...

Has the server ever been upgraded, or have other DBMS tools installed? AKA, are you running the correct bcp.exe?

I've seen this before where the "bcp.exe" found when looking in the %PATH% variable is not the one you expect to run...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文