开发者

32bit OSQL issue with 64bit Windows+64bit SQL Server

开发者 https://www.devze.com 2023-01-06 18:12 出处:网络
I have a Windows 2008 x64 server and with SQL Server 2008 x64 installed. osql.exe under SQL Server directory could list instances with -L. I copied osql.exe+osql.rll from another SQL Server 2005 x86 a

I have a Windows 2008 x64 server and with SQL Server 2008 x64 installed. osql.exe under SQL Server directory could list instances with -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".

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. I also checked MDAC version, it's 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. And osql.rll isn't necessary, the osql.exe only needs msvcr71.dll.

What can i do to make osql.ex开发者_Python百科e(from sql 2005) to run on the server? And are there any difference between those 2 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.

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. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消