?
C:\>osql /?
用法: 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 "cmdline query"]?? [-Q "cmdline 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> 正在進行批處理
????? 控制臺寬度自動調整
????? 寬消息
????? 默認錯誤級別為 — 1 對 1
? [-? show syntax summary]
Windows集成身份登陸>>>
C:\>osql -E
1>
登陸后執行系統存儲過程
1> sp_password NULL,"newpass","sa"
2> go
密碼已更改。
1> exit
再來看看sa混合模式登陸>>>
C:\>osql -SLocalhost -Usa -Pnewpass
1>
出現1>提示符表示登陸成功!
再來看看osql命令行下查詢C:\>osql -SLocalhost -Usa -Pnewpass
1> use qz
2> Select count(*) from crjsj where kh=0
3> go
?-----------
?????????? 0
(1 行受到影響)
1>
查詢系統表
1> select name from sysobjects where xtype='U'
2> go
?name