China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-25 05:04
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Looking for command-line tools similar to OSQL and SQLCMD View 7,089 Replies 29
Original Poster Posted 2009-02-06 15:02 ·  中国 北京 鹏博士长城宽带
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
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 ]

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 2 Posted 2009-02-06 15:35 ·  中国 北京 鹏博士长城宽带
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
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 ]

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 3 Posted 2009-02-06 18:21 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline
You can directly copy osql.exe to the local and use it, no need to install SQL SERVER.
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
yishanju +8 2009-02-06 18:59
Floor 4 Posted 2009-02-06 18:38 ·  中国 北京 鹏博士长城宽带
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
Local system WINDOWS XP SP3
Server windows 2003 SP2
Database MS SQLVER 2005

All tried... No good

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 5 Posted 2009-02-06 18:42 ·  中国 北京 鹏博士长城宽带
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
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. ???????????

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 6 Posted 2009-02-06 18:46 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline
Oh, my local here is win2k3, and I haven't installed SQL Server.

It is suggested to switch to win2k3...
Floor 7 Posted 2009-02-06 19:00 ·  中国 北京 鹏博士长城宽带
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
I have many servers, I'll try more

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 8 Posted 2009-02-06 20:00 ·  中国 北京 鹏博士长城宽带
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
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.

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 9 Posted 2009-02-08 02:51 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline
What is the specific command you execute for osql? Let's see what the output of osql -L is.
Floor 10 Posted 2009-02-08 06:54 ·  中国 广东 广州 天河区 电信
金牌会员
★★★★
一叶枝头,万树皆春
Credits 2,564
Posts 1,127
Joined 2006-12-25 22:57
19-year member
UID 74552
Gender Male
Status Offline
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.
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
yishanju +8 2009-02-08 20:10
49206C6F766520796F752067757973 54656C3A3133383238343036373837
Floor 11 Posted 2009-02-08 20:13 ·  中国 北京 联通
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
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?

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 12 Posted 2009-02-09 03:59 ·  中国 北京 联通
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
I asked a question on Baidu Knows, come and teach me how to use SQLCMD, I'm crying

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 13 Posted 2009-02-09 04:02 ·  中国 北京 联通
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
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

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 14 Posted 2009-02-09 09:49 ·  中国 福建 泉州 电信
银牌会员
★★★
Credits 1,276
Posts 469
Joined 2002-12-23 13:00
23-year member
UID 586
Gender Male
From 福建泉州
Status Offline
Can SQL2000 version of OSQL or ISQL connect to SQL2005 database? If yes, then using SQL2000's OSQL is okay.
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
yishanju +8 2009-02-13 16:08
QQ:366840202
http://chenall.net
Floor 15 Posted 2009-02-09 09:51 ·  中国 福建 泉州 电信
银牌会员
★★★
Credits 1,276
Posts 469
Joined 2002-12-23 13:00
23-year member
UID 586
Gender Male
From 福建泉州
Status Offline
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.
QQ:366840202
http://chenall.net
Forum Jump: