Sybase BCP与MS SQL BCP [英] Sybase BCP vs MS SQL BCP

查看:90
本文介绍了Sybase BCP与MS SQL BCP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个需要使用的多数据库设置,并且两个都有各自的bcp版本,它们的行为方式不同.再加上两者都在我的%PATH%中,并且Sybase一个在MS SQL exe之前列出,因此从命令行调用"bcp"总是会命中Sybase exe.

I have a multi-database setup that I need to work with and both have their own bcp versions that do not act the same way. Plus both are in my %PATH% and the Sybase one is listed before the MS SQL exe so calling "bcp" from the command line always hits the Sybase exe.

首先,版本是不同的":

First, the versions are "different":

Sybase BCP: Sybase CTBCP实用程序/15.0/P-EBF17890 ESD#24/PC Intel/BUILD1500-123/OPT/Thu 2010年5月13日02:45:43 (适用于Adaptive Server Enterprise/15.7/EBF 23008 SMP SP130/P/RS6000/AIX 6.1/ase157sp13x/3819/64-bit/FBO/Sat Aug 23 02:49:06 2014)

Sybase BCP: Sybase CTBCP Utility/15.0/P-EBF17890 ESD #24/PC Intel/BUILD1500-123/OPT/Thu May 13 02:45:43 2010 (for Adaptive Server Enterprise/15.7/EBF 23008 SMP SP130 /P/RS6000/AIX 6.1/ase157sp13x/3819/64-bit/FBO/Sat Aug 23 02:49:06 2014)

MS SQL BCP: 版本:11.0.2100.60 (查询达到SQL 2008 R2和2012 SP3数据库)

MS SQL BCP: Version: 11.0.2100.60 (queries hitting SQL 2008 R2 and 2012 SP3 dbs)

他们绝对不会以相同的方式处理输出到文件,每个文件的文档都表明了这一点.我在bcp上看到的所有内容都表明,bcp在Sybase和MS SQL之间应该能以相同的方式工作,但是我必须调用完整的MS SQL bcp.exe路径才能对MS SQL进行查询输出,因为Sybase bcp不以相同的方式支持queryout.

They definitely do not handle output to a file the same way and the docs for each show that. Everything I read on bcp says that bcp should work the same between Sybase and MS SQL but I have to call the full MS SQL bcp.exe path for a queryout call to MS SQL because the Sybase bcp does not support the queryout the same way.

我的过程使用批处理脚本来调用打到Sybase DBS的多个查询,然后使用MS SQL数据库将数据输出到暂存db,我将始终必须区分Sybase和MS SQL bcp还是仅使用一个没有问题吗?如果是这样,则使用哪一个是正确的"选择(而不是在此处引发争论,哪个更好).而且,我看不到任何迹象表明版本号具有任何关系,因此知道哪个是最新的",并证明使用该版本是困难的.

My process uses a batch script to call multiple queries that hit the Sybase DBS and then MS SQL databases to output data to a staging db, will I always have to differentiate between the Sybase and MS SQL bcp's or can I use just one without issue? If so, which one is the "right" one to use (not trying to spark a debate here on which is better). Also, I see nothing showing that the version numbers have any relation what so ever so knowing which is the "latest" and using that one is proving difficult.

推荐答案

请记住,MS SQL Server早在1994年就与Sybase ASE相同(称为Sybase SQL Server),但是在那之后,它们开始慢慢分开. .因此,BCP的概念仍然存在并且相似,但是细节不同. 一方面,不要期望能够为这些数据库交换客户端工具:Microsoft对TDS协议进行了更改,使得无法将客户端连接到其他供应商的数据库.

Keep in mind that MS SQL Server was identical to Sybase ASE back in 1994 (the called Sybase SQL Server), but after that, they slowly started to move apart. So the concept of BCP is still there and similar, but the details are different. For one thing, do not expect to be able to interchange client tools for these databases: Microsoft has made changes to the TDS protocol that makes it impossible to connect a client to the other vendor's databases.

如果两个具有相同名称的可执行文件之间存在冲突,常见的解决方案包括(i)显式指定可执行文件的路径名(ii)在调用一个或另一个可执行文件之前设置正确的环境变量(iii)重命名一个可执行文件可执行文件. YMMV.

If you've got a clash between to two executables with the same name, common solutions include (i) explicitly specifying the executable's pathname (ii) setting the right environment variables before calling one or the other executable (iii) renaming one of the executables. YMMV.

这篇关于Sybase BCP与MS SQL BCP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆