SQL 命令提示实用工具 (数据库引擎)SQL Command Prompt Utilities (Database Engine)

适用对象:是SQL Server 是Azure SQL 数据库 是Azure Synapse Analytics (SQL DW) 是并行数据仓库APPLIES TO: yesSQL Server yesAzure SQL Database yesAzure Synapse Analytics (SQL DW) yesParallel Data Warehouse

使用命令提示实用工具,可以编写 SQL ServerSQL Server 操作的脚本。Command prompt utilities enable you to script SQL ServerSQL Server operations. 下表包含了随 SQL ServerSQL Server 提供的多个命令提示实用工具列表。The following table contains a list of many command prompt utilities that ship with SQL ServerSQL Server.

有关主要的 SQL gui 和命令行工具的信息, 请参阅sql 工具概述For information on the main SQL gui and command-line tools, see SQL Tools Overview.

实用工具Utility DescriptionDescription 安装位置Installed in
bcp 实用工具bcp Utility 用于在 MicrosoftMicrosoft SQL ServerSQL Server 实例和用户指定格式的数据文件之间复制数据。Used to copy data between an instance of MicrosoftMicrosoft SQL ServerSQL Server and a data file in a user-specified format. <驱动器:>\Program Files\MicrosoftMicrosoftSQL ServerSQL Server\Client SDK\ODBC\110\Tools\Binn <drive:>\Program Files\MicrosoftMicrosoftSQL ServerSQL Server\Client SDK\ODBC\110\Tools\Binn
dta 实用工具dta Utility 用于分析工作负荷并建议物理设计结构,以优化该工作负荷下的服务器性能。Used to analyze a workload and recommend physical design structures to optimize server performance for that workload. <drive>:\Program Files\Microsoft SQL Server\nnn<drive>:\Program Files\Microsoft SQL Server\nnn\Tools\BinnTools\Binn
dtexec 实用工具dtexec Utility 用于配置和执行 Integration ServicesIntegration Services 包。Used to configure and execute an Integration ServicesIntegration Services package. 该命令提示实用工具的用户界面版本称为 DTExecUI,它可提供执行包实用工具。A user interface version of this command prompt utility is called DTExecUI, which brings up the Execute Package Utility. <drive>:\Program Files\Microsoft SQL Server\nnn<drive>:\Program Files\Microsoft SQL Server\nnn\DTS\BinnDTS\Binn
dtutil 实用工具dtutil Utility 用于管理 SSIS 包。Used to manage SSIS packages. <drive>:\Program Files\Microsoft SQL Server\nnn<drive>:\Program Files\Microsoft SQL Server\nnn\DTS\BinnDTS\Binn
使用部署实用工具部署模型解决方案Deploy Model Solutions with the Deployment Utility 用于将 Analysis ServicesAnalysis Services 项目部署到 Analysis ServicesAnalysis Services实例。Used to deploy Analysis ServicesAnalysis Services projects to instances of Analysis ServicesAnalysis Services. <drive>:\Program Files\Microsoft SQL Server\nnn<drive>:\Program Files\Microsoft SQL Server\nnn\Tools\Binn\VShell\Common7\IDETools\Binn\VShell\Common7\IDE
osql 实用工具osql Utility 您可以在命令提示符下输入 Transact-SQLTransact-SQL 语句、系统过程和脚本文件。Allows you to enter Transact-SQLTransact-SQL statements, system procedures, and script files at the command prompt. <drive>:\Program Files\Microsoft SQL Server\nnn<drive>:\Program Files\Microsoft SQL Server\nnn\Tools\BinnTools\Binn
Profiler 实用工具Profiler Utility 用于在命令提示符下启动 SQL Server ProfilerSQL Server ProfilerUsed to start SQL Server ProfilerSQL Server Profiler from a command prompt. <drive>:\Program Files\Microsoft SQL Server\nnn<drive>:\Program Files\Microsoft SQL Server\nnn\Tools\BinnTools\Binn
RS.exe 实用工具 (SSRS)RS.exe Utility (SSRS) 用于运行专门管理 Reporting ServicesReporting Services 报表服务器的脚本。Used to run scripts designed for managing Reporting ServicesReporting Services report servers. <drive>:\Program Files\Microsoft SQL Server\nnn<drive>:\Program Files\Microsoft SQL Server\nnn\Tools\BinnTools\Binn
rsconfig 实用工具 (SSRS)rsconfig Utility (SSRS) 用于配置报表服务器连接。Used to configure a report server connection. <drive>:\Program Files\Microsoft SQL Server\nnn<drive>:\Program Files\Microsoft SQL Server\nnn\Tools\BinnTools\Binn
rskeymgmt 实用工具 (SSRS)rskeymgmt Utility (SSRS) 用于管理报表服务器上的加密密钥。Used to manage encryption keys on a report server. <drive>:\Program Files\Microsoft SQL Server\nnn<drive>:\Program Files\Microsoft SQL Server\nnn\Tools\BinnTools\Binn
sqlagent90 应用程序sqlagent90 Application 用于在命令提示符下启动 SQL ServerSQL Server 代理。Used to start SQL ServerSQL Server Agent from a command prompt. <驱动器>:\Program Files\Microsoft SQL Server\<instance_name>\MSSQL\Binn<drive>:\Program Files\Microsoft SQL Server\<instance_name>\MSSQL\Binn
sqlcmd Utilitysqlcmd Utility 您可以在命令提示符下输入 Transact-SQLTransact-SQL 语句、系统过程和脚本文件。Allows you to enter Transact-SQLTransact-SQL statements, system procedures, and script files at the command prompt. <驱动器:>\Program Files\MicrosoftMicrosoftSQL ServerSQL Server\Client SDK\ODBC\110\Tools\Binn <drive:>\Program Files\MicrosoftMicrosoftSQL ServerSQL Server\Client SDK\ODBC\110\Tools\Binn
SQLdiag 实用工具SQLdiag Utility 用于为 MicrosoftMicrosoft 客户服务和支持部门收集诊断信息。Used to collect diagnostic information for MicrosoftMicrosoft Customer Service and Support. <drive>:\Program Files\Microsoft SQL Server\nnn<drive>:\Program Files\Microsoft SQL Server\nnn\Tools\BinnTools\Binn
sqllogship 应用程序sqllogship Application 应用程序可用其执行日志传送配置中的备份、复制和还原操作以及相关的清除任务,而无需运行备份、复制和还原作业。Used by applications to perform backup, copy, and restore operations and associated clean-up tasks for a log shipping configuration without running the backup, copy, and restore jobs. <drive>:\Program Files\Microsoft SQL Server\nnn<drive>:\Program Files\Microsoft SQL Server\nnn\Tools\BinnTools\Binn
SqlLocalDB 实用工具SqlLocalDB Utility 针对程序开发人员的 SQL ServerSQL Server 的执行模式。An execution mode of SQL ServerSQL Server targeted to program developers. <drive>:\Program Files\Microsoft SQL Server\nnn<drive>:\Program Files\Microsoft SQL Server\nnn\Tools\BinnTools\Binn
sqlmaint 实用工具sqlmaint Utility 用于执行在早期版本的 SQL ServerSQL Server中创建的数据库维护计划。Used to execute database maintenance plans created in previous versions of SQL ServerSQL Server. <驱动器>:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Binn<drive>:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Binn
sqlps 实用工具sqlps Utility 用于运行 PowerShell 命令和脚本。Used to run PowerShell commands and scripts. 加载和注册 SQL ServerSQL Server PowerShell 提供程序和 cmdlet。Loads and registers the SQL ServerSQL Server PowerShell provider and cmdlets. <drive>:\Program Files\Microsoft SQL Server\nnn<drive>:\Program Files\Microsoft SQL Server\nnn\Tools\BinnTools\Binn
sqlservr Applicationsqlservr Application 用于在命令提示符下启动和停止 数据库引擎Database Engine 实例以进行故障排除。Used to start and stop an instance of 数据库引擎Database Engine from the command prompt for troubleshooting. <驱动器>:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Binn<drive>:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Binn
Ssms 实用工具Ssms Utility 用于在命令提示符下启动 SQL Server Management StudioSQL Server Management StudioUsed to start SQL Server Management StudioSQL Server Management Studio from a command prompt. <drive>:\Program Files\Microsoft SQL Server\nnn<drive>:\Program Files\Microsoft SQL Server\nnn\Tools\Binn\VSShell\Common7\IDETools\Binn\VSShell\Common7\IDE
tablediff 实用工具tablediff Utility 用于比较两个表中的数据以查看数据是否无法收敛,这对于排除复制拓扑故障很有用。Used to compare the data in two tables for non-convergence, which is useful when troubleshooting a replication topology. <drive>:\Program Files\Microsoft SQL Server\nnn<drive>:\Program Files\Microsoft SQL Server\nnn\COMCOM

命令提示实用工具语法约定Command Prompt Utilities Syntax Conventions

约定Convention 用于Used for
大写UPPERCASE 在操作系统层使用的语句和术语。Statements and terms used at the operating system level.
monospace 示例命令和程序代码。Sample commands and program code.
斜体italic 用户提供的参数。User-supplied parameters.
粗体bold 命令、参数和其他必须严格按所给形式键入的语法。Commands, parameters, and other syntax that must be typed exactly as shown.

另请参阅See Also

复制分发代理 Replication Distribution Agent
复制日志读取器代理 Replication Log Reader Agent
复制合并代理 Replication Merge Agent
复制队列读取器代理 Replication Queue Reader Agent
复制快照代理Replication Snapshot Agent