【经典】sqlcmd 和 osql(Sql Server)
来源:互联网 发布:计数器软件下载 编辑:程序博客网 时间:2024/06/08 12:02
【转】 http://hi.baidu.com/wyd45123/blog/item/33fa574e3bf50dc1d0c86a82.html
新的sqlcmd取代了Sql Server 2000的osql
通过osql来列出本地网内的Sql Server 服务器列表。使用参数有两种显示方式。
C:/Documents and Settings/Administrator>sqlcmd -L
C:/Documents and Settings/Administrator>sqlcmd -Lc
连接本地数据库sqlexpress版本
sqlcmd -S ./sqlexpress
以下是osql和sqlcmd的帮助:
C:/Documents and Settings/...>osql/?
Microsoft (R) SQL Server Command Line Tool
Version 10.0.1600.22 NT INTEL X86
Copyright (c) Microsoft Corporation. All rights reserved.
Note: osql does not support all features of SQL Server 2008.
Use sqlcmd instead. See SQL Server Books Online for details.
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 "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]
[-X[1] disable commands [and exit with warning]]
[-O use Old ISQL behavior disables the following]
<EOF> batch processing
Auto console width scaling
Wide messages
default errorlevel is -1 vs 1
[-? show syntax summary]
-----------------------------------------------------------
C:/Documents and Settings/wangyd>sqlcmd/?
Microsoft (R) SQL Server Command Line Tool
Version 10.0.1600.22 NT INTEL X86
Copyright (c) Microsoft Corporation. All rights reserved.
usage: Sqlcmd [-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 screen width]
[-a packetsize] [-e echo input] [-I Enable Quoted Identifiers]
[-c cmdend] [-L[c] list servers[clean output]]
[-q "cmdline query"] [-Q "cmdline query" and exit]
[-m errorlevel] [-V severitylevel] [-W remove trailing spaces]
[-u unicode output] [-r[0|1] msgs to stderr]
[-i inputfile] [-o outputfile] [-z new password]
[-f <codepage> | i:<codepage>[,o:<codepage>]] [-Z new password and exit]
[-k[1|2] remove[replace] control characters]
[-y variable length type display width]
[-Y fixed length type display width]
[-p[1] print statistics[colon format]]
[-R use client regional setting]
[-b On error batch abort]
[-v var = "value"...] [-A dedicated admin connection]
[-X[1] disable commands, startup script, enviroment variables [and exit]]
[-x disable variable substitution]
[-? show syntax summary]
更多参考:http://msdn.microsoft.com/zh-cn/library/ms180944.aspx
- 【经典】sqlcmd 和 osql(Sql Server)
- OSQL和SQLCMD 下载
- [sql server] 在isql、osql、sqlcmd中调用脚本执行
- SQL Server中osql/sqlcmd的基本用法
- osql and sqlcmd switches
- 【经典】使用 Osql 工具管理 SQL Server 桌面引擎 (MSDE 2000)
- SQL Server 管理常用的osql
- SQL Server 2005中的SQLCMD工具使用
- SQL Server 2005中的SQLCMD工具使用
- SQL Server 2005中的SQLCMD工具使用
- 使用 sqlcmd 实用工具 (SQL Server Express)
- 关于 sql server sqlcmd 异常捕捉 %errorlevel%
- 基于sqlcmd命令行工具管理SQL server
- sqlserver的sqlcmd、osql、isql使用工具
- OSQL/ISQL——SQL SERVER中的SQL*PLUS
- 使用 Osql 工具管理 SQL Server 桌面引擎 (MSDE 2000)
- 使用 Osql 工具管理 SQL Server 桌面引擎 (MSDE 2000)
- 使用 Osql 工具管理 SQL Server 桌面引擎 (MSDE 2000)
- struts 中如何访问资源文件,JSP页面中如何实现国际化显示
- SQL Server 管理常用的osql
- 数据接口
- 【经典】使用 Osql 工具管理 SQL Server 桌面引擎 (MSDE 2000)
- 引用类型实现的单件模式
- 【经典】sqlcmd 和 osql(Sql Server)
- linux C 参考书籍
- 应一个朋友的要求,贴上收藏的SQL常用分页的办法~~
- 关于“逆序数”的一些题目
- [Jakarta Commons笔记] 序
- 2010-02-06
- Microsoft’s Creative Destruction(-)-微软的创新灾难
- Silverlight加载xap后通过反射相互调用方法及元素
- C#操作MS SQL Server 数据库的通用类