C: \> osql /?
Usage: osql [-u Login ID] [-P Password]
[-S server] [-H hostname] [-e trusted connection]
[-D use database name] [-l login timeout] [-T query timeout]
[-H headers] [-s colseparator] [-W columnwidth]
[-A packetsize] [-e echo input] [-I enable quoted identifiers]
[-L list servers] [-C cmdend] [-d odbc dsn name]
[-Q "Explain line query"] [-Q "Explain line query" and exit]
[-N remove numbering] [-M errorlevel]
[-R msgs to stderr] [-V severitylevel]
[-I inputfile] [-O outputfile]
[-P print statistics] [-B on error batch abort]
[-O use old iSQL behavior disables the following]
<EOF> batch processing in progress
Console width auto-Adjusted
Wide message
The default error level is-1 to 1.
[-? Show syntax Summary]
Windows Integrated Identity login >>>
C: \> osql-e
1>
Execute system stored procedures after login
1> sp_password null, "newpass", "sa"
2> go
The password has been changed.
1> exit
Let's take a look at SA hybrid login >>>
C: \> osql-slocalhost-USA-pnewpass
1>
1> A prompt is displayed, indicating that the logon is successful!
Let's take a look at the osql command line to query c: \> osql-slocalhost-USA-pnewpass
1> Use qz
2> select count (*) from crjsj where kh = 0
3> go
-----------
0
(Line 1 is affected)
1>
Query System Table
1> select name from sysobjects where xtype = 'U'
2> go
Name
-------------------------------------------------------------------------------
-------------------------------------------------
SJD
Sjdz
Xgjsz
Xtcs
PB
Xtsz
Qjcc
Rszl
Rz
T_open_event
T_open_event_history
Xgsj
T_opendoorrecord_history
Mjjcs2
T_opendoorrecord
Mjjz2
Mjkzqcs2
Dtproperties
Qjcc1.
Sjlxsm
Kqsj2
Bell
BM
Card
Department
Crjsj
Ugly
Gzsj_history
Crjsj_history
JR
Gzsj
Kqjsz
Gzsj_ssjksj
Info
Lever
Kqbc
Kqsj
Kqsj_tp
Lscrjsj
Mjjcs
Msgrz
Parameter
Picture
Mjjz
Qjlb
Mjkzqcs
(46 rows affected)
1> exit
C: \> the osql command line has many functions and is often used as an example.