SQL 命令提示字元公用程式 (Database Engine)SQL Command Prompt Utilities (Database Engine)

本主題的適用對象: 是SQL Server是Azure SQL Database是Azure SQL 資料倉儲是Parallel Data WarehouseTHIS TOPIC APPLIES TO: yesSQL ServeryesAzure SQL DatabaseyesAzure SQL Data Warehouse 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 command prompt utilities that ship with SQL ServerSQL Server.

公用程式Utility 說明Description 安裝位置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\ MicrosoftMicrosoft SQL ServerSQL Server\Client SDK\ODBC\110\Tools\Binn<drive:>\Program Files\ MicrosoftMicrosoft SQL 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. <磁碟機>:\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. <磁碟機>:\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. <磁碟機>:\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. <磁碟機>:\Program Files\Microsoft SQL Server\nnn\<drive>:\Program Files\Microsoft SQL Server\nnn\Tools\Binn\VShell\Common7\IDETools\Binn\VShell\Common7\IDE
mssql scripter (公開預覽)mssql-scripter (Public Preview) 用來產生 SQL Server、 Azure SQL Database 和 Azure SQL 資料倉儲中的資料庫物件的建立及插入 T-SQL 指令碼。Used to generate CREATE and INSERT T-SQL scripts for database objects in SQL Server, Azure SQL Database, and Azure SQL Data Warehouse. 請參閱我們GitHub 儲存機制下載和使用方式資訊。See our GitHub repo for download and usage information.
osql 公用程式osql Utility 可讓您在命令提示字元之下,輸入 Transact-SQLTransact-SQL 陳述式、系統程序和指令碼檔案。Allows you to enter Transact-SQLTransact-SQL statements, system procedures, and script files at the command prompt. <磁碟機>:\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. <磁碟機>:\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. <磁碟機>:\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. <磁碟機>:\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. <磁碟機>:\Program Files\Microsoft SQL Server\nnn\<drive>:\Program Files\Microsoft SQL Server\nnn\Tools\BinnTools\Binn
sqlagent90 應用程式sqlagent90 Application 用來從命令提示字元啟動 SQL ServerSQL Server Agent。Used to start SQL ServerSQL Server Agent from a command prompt. <磁碟機 >: SQL Server \Program Files\Microsoft\<instance_name> \MSSQL\Binn<drive>:\Program Files\Microsoft SQL Server\<instance_name>\MSSQL\Binn
sqlcmd 工用程式sqlcmd Utility 可讓您在命令提示字元之下,輸入 Transact-SQLTransact-SQL 陳述式、系統程序和指令碼檔案。Allows you to enter Transact-SQLTransact-SQL statements, system procedures, and script files at the command prompt. <磁碟機: > \Program Files\ MicrosoftMicrosoft SQL ServerSQL Server\Client SDK\ODBC\110\Tools\Binn<drive:>\Program Files\ MicrosoftMicrosoft SQL ServerSQL Server\Client SDK\ODBC\110\Tools\Binn
SQLdiag 公用程式SQLdiag Utility 用以收集可供 MicrosoftMicrosoft 客戶服務與支援部門使用的診斷資訊。Used to collect diagnostic information for MicrosoftMicrosoft Customer Service and Support. <磁碟機>:\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. <磁碟機>:\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. <磁碟機>:\Program Files\Microsoft SQL Server\nnn\<drive>:\Program Files\Microsoft SQL Server\nnn\Tools\Binn\Tools\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. <磁碟機>:\Program Files\Microsoft SQL Server\nnn\<drive>:\Program Files\Microsoft SQL Server\nnn\Tools\BinnTools\Binn
sqlservr 應用程式sqlservr Application 用來從命令提示字元啟動和停止 Database EngineDatabase Engine 執行個體,以進行疑難排解。Used to start and stop an instance of Database EngineDatabase 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 用來從命令提示字元啟動 Transact-SQLSQL Server Management StudioUsed to start Transact-SQLSQL Server Management Studio from a command prompt. <磁碟機>:\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. <磁碟機>:\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 AgentReplication Snapshot Agent