中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-11 08:39
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS批处理 & 脚本技术(批处理室) » Looking for command-line tools similar to OSQL and SQLCMD
Printable Version  7,687 / 29
Floor1 yishanju Posted 2009-02-06 15:02
银牌会员 Posts 1,357 Credits 1,488
OSQL and SQLCMD are command-line tools provided by MS SQL Server 2005, which can execute SQL statements in command-line batch processing.

If these two tools are used in batch processing, SQL Server 2005 needs to be installed to work properly.
So now we are looking for similar tools, or the method of extracting OSQL and SQLCMD separately without installing SQL 2005.

I have copied OSQL and SQLCMD, but they cannot run normally when placed on other servers.
Download OSQL and SQLCMD.rar http://upload.cn-dos.net/img/1290.rar

Here you can download: OSQL and ISQL programs extracted from SQL 2000 http://www.k68.cn/PostViewMission.asp?rmd=19260&BoardID=1001&imageID=86893

[ Last edited by yishanju on 2010-4-3 at 13:40 ]
Floor2 yishanju Posted 2009-02-06 15:35
银牌会员 Posts 1,357 Credits 1,488
The fully automatic background addition .bat I wrote uses SQLCMD http://www.cn-dos.net/forum/viewthread.php?tid=45836&fpage=1

[ Last edited by yishanju on 2009-2-9 at 04:00 ]
Floor3 lxmxn Posted 2009-02-06 18:21
版主 Posts 4,938 Credits 11,386
You can directly copy osql.exe to the local and use it, no need to install SQL SERVER.
Floor4 yishanju Posted 2009-02-06 18:38
银牌会员 Posts 1,357 Credits 1,488
Local system WINDOWS XP SP3
Server windows 2003 SP2
Database MS SQLVER 2005

All tried... No good
Floor5 yishanju Posted 2009-02-06 18:42
银牌会员 Posts 1,357 Credits 1,488
Copying OSQL from a Windows 2003 machine to my XP machine and running it, the following is prompted

F:\Check Guild Amount>osql

Failed to load resource file OSQL.rll. ???????????
Floor6 lxmxn Posted 2009-02-06 18:46
版主 Posts 4,938 Credits 11,386
Oh, my local here is win2k3, and I haven't installed SQL Server.

It is suggested to switch to win2k3...
Floor7 yishanju Posted 2009-02-06 19:00
银牌会员 Posts 1,357 Credits 1,488
I have many servers, I'll try more
Floor8 yishanju Posted 2009-02-06 20:00
银牌会员 Posts 1,357 Credits 1,488
On one of the internal network Windows 2003 SP2 machines, running OSQL did not find a data source and did not specify a default driver. Directly running SQLCMD prompts that the application failed to run due to incorrect application configuration. Reinstalling the application may solve this problem.
Floor9 lxmxn Posted 2009-02-08 02:51
版主 Posts 4,938 Credits 11,386
What is the specific command you execute for osql? Let's see what the output of osql -L is.
Floor10 everest79 Posted 2009-02-08 06:54
金牌会员 Posts 1,127 Credits 2,564
There is a patch about SQL. Actually, it's for the SQL remote management interface. After applying it, you can directly use these commands without installation.
Floor11 yishanju Posted 2009-02-08 20:13
银牌会员 Posts 1,357 Credits 1,488
Originally posted by everest79 at 2009-2-8 06:54:
There is a patch related to SQL, actually it's for the SQL remote management interface. After applying it, you can directly use these commands without installation.


Really? But how can I find this patch?
Floor12 yishanju Posted 2009-02-09 03:59
银牌会员 Posts 1,357 Credits 1,488
I asked a question on Baidu Knows, come and teach me how to use SQLCMD, I'm crying
Floor13 yishanju Posted 2009-02-09 04:02
银牌会员 Posts 1,357 Credits 1,488
F:\TDDOWNLOAD\Software\SQLCMD>OSQL -L
[ODBC Driver Manager] No data source name was found and no default driver was specified
[ODBC Driver Manager] Connection not open
Floor14 chenall Posted 2009-02-09 09:49
银牌会员 Posts 469 Credits 1,276 From 福建泉州
Can SQL2000 version of OSQL or ISQL connect to SQL2005 database? If yes, then using SQL2000's OSQL is okay.
Floor15 chenall Posted 2009-02-09 09:51
银牌会员 Posts 469 Credits 1,276 From 福建泉州
Looking at the prompt, it's not that it can't be used, but there's an issue with the system. There's no corresponding ODBC driver. Maybe it's a stripped-down version system. Try installing MDAC.
1 2  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023