简体   繁体   English

64位Windows + 64位SQL Server的32位OSQL问题

[英]32bit OSQL issue with 64bit Windows+64bit SQL Server

I have a Windows 2008 x64 server and with SQL Server 2008 x64 installed. 我有一台Windows 2008 x64服​​务器,并安装了SQL Server 2008 x64。 osql.exe under SQL Server directory could list instances with -L. SQL Server目录下的osql.exe可以列出带有-L的实例。 I copied osql.exe+osql.rll from another SQL Server 2005 x86 and '.\\osql.exe -L' returns error like "[ODBC Driver Manager] Data source name not found and no default driver specified". 我从另一个SQL Server 2005 x86复制了osql.exe + osql.rll,并且'。\\ osql.exe -L'返回错误,例如“未找到[ODBC驱动程序管理器]数据源名称且未指定默认驱动程序”。

After check registry 'HKLM\\SOFTWARE\\Wow6432Node\\ODBC\\ODBCINST.INI', the 'SQL Server' and 'SQL Server Native Client 10.0' are ok and related dll files are ok. 检查注册表“ HKLM \\ SOFTWARE \\ Wow6432Node \\ ODBC \\ ODBCINST.INI”后,“ SQL Server”和“ SQL Server Native Client 10.0”正常,相关的dll文件正常。 I also checked MDAC version, it's 6.0.6002.18005. 我还检查了MDAC版本,即6.0.6002.18005。 Did i miss anything? 我想念什么吗?

One interesting thing is osql.exe from SQL Server 2000 ran well to list instances on the server. 有趣的是,SQL Server 2000的osql.exe运行良好,可以列出服务器上的实例。 And osql.rll isn't necessary, the osql.exe only needs msvcr71.dll. 而且不需要osql.rll,osql.exe只需要msvcr71.dll。

What can i do to make osql.exe(from sql 2005) to run on the server? 我该怎么做才能使osql.exe(从sql 2005开始)在服务器上运行? And are there any difference between those 2 osql.exe(sql 2005, sql 2000)? 那两个osql.exe(sql 2005,sql 2000)之间有什么区别?

As DaveShaw said, you should probably be using SQLCMD.EXE instead... fortunately the syntax is quite comparable to the old OSQL.EXE, so the transition shouldn't be hard. 正如DaveShaw所说,您可能应该改用SQLCMD.EXE ...幸运的是,语法与旧的OSQL.EXE相当,因此过渡不难。

You can download SQLCMD (a/k/a the Microsoft SQL Server 2005 Command Line Query Utility ) from the latest Feature Pack for SQL Server 2005 page . 您可以从最新的SQL Server 2005功能包页面下载SQLCMD( Microsoft SQL Server 2005命令行查询实用程序 )。 Install the appropriate SQLCMD and the SQL Server Native Client (also on the same page) and you can run the commands from any client system on the network, x86 or x64 no matter. 安装适当的SQLCMD和SQL Server本机客户端(也在同一页面上),无论如何,您都可以从网络上的任何客户端系统(x86或x64)运行命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM