SQL 工具和公用程式 SQL Server、 Azure SQL Database 和 Azure SQL 資料倉儲SQL Tools and Utilities for SQL Server, Azure SQL Database, and Azure SQL Data Warehouse

本主題適用於: 是SQL Server是Azure SQL Database是Azure SQL 資料倉儲 是平行處理資料倉儲 THIS TOPIC APPLIES TO: yesSQL ServeryesAzure SQL DatabaseyesAzure SQL Data Warehouse yesParallel Data Warehouse

若要管理 (查詢、 監視等) 您需要一項工具的資料庫。To manage (query, monitor, etc.) your database you need a tool. 有數個資料庫的工具。There are several database tools available. 您的資料庫可以執行在雲端中,在 Windows 中,或上時Linux,不需要與資料庫相同的平台上執行您的工具。While your databases can be running in the cloud, on Windows, or on Linux, your tool doesn't need to run on the same platform as the database.

本文章提供可用的工具來處理 SQL 資料庫的相關資訊。This article provides information about the available tools for working with your SQL databases.

執行查詢及管理資料庫的工具Tools to run queries and manage databases

工具Tool 描述Description
Microsoft SQL Operations Studio (預覽)Microsoft SQL Operations Studio (preview) SQL Operations Studio (預覽)SQL Operations Studio (preview) 是免費的輕量型工具,管理資料庫,只要它們正在執行。 is a free, light-weight tool, for managing databases wherever they're running. 此預覽版本提供的資料庫管理功能,包括擴充的 TRANSACT-SQL 編輯器和可自訂的深入剖析您資料庫的操作狀態。This preview release provides database management features, including an extended Transact-SQL editor and customizable insights into the operational state of your databases. SQL Operations Studio (預覽)SQL Operations Studio (preview) 在 Windows、 macOS 和 Linux 上執行SQL Operations Studio (預覽)SQL Operations Studio (preview) runs on Windows, macOS, and Linux.
SQL Server Management Studio (SSMS)SQL Server Management Studio (SSMS) 您可以使用 SQL Server Management Studio (SSMS) 來查詢、 設計和管理 SQL Server、 Azure SQL Database 和 Azure SQL 資料倉儲。Use SQL Server Management Studio (SSMS) to query, design, and manage your SQL Server, Azure SQL Database, and Azure SQL Data Warehouse. 在 Windows 上執行 SSMSSSMS runs on Windows.
SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) 開啟 Visual Studio 強大的開發環境中 SQL Server、 Azure SQL Database 和 Azure SQL 資料倉儲。Turn Visual Studio into a powerful development environment for SQL Server, Azure SQL Database, and Azure SQL Data Warehouse. 在 Windows 上執行 SSDTSSDT runs on Windows.
mssql climssql-cli mssql cli 是互動式命令列工具來查詢 SQL Server。mssql-cli is an interactive command-line tool for querying SQL Server. 執行 Windows、 macOS 和 Linux 上的 mssql climssql-cli runs on Windows, macOS, and Linux
Visual Studio CodeVisual Studio Code 安裝 Visual Studio 程式碼之後, 安裝mssql 延伸開發 Microsoft SQL Server、 Azure SQL Database 和 SQL 資料倉儲。After installing Visual Studio Code, install the mssql extension for developing Microsoft SQL Server, Azure SQL Database, and SQL Data Warehouse. 在 Windows、 macOS 和 Linux 上執行 visual Studio CodeVisual Studio Code runs on Windows, macOS, and Linux.

我應該選擇哪一種工具?Which tool should I choose?

其他工具Additional tools

工具Tool 描述Description
組態管理員Configuration Manager 使用 SQL Server 組態管理員來設定 SQL Server 服務和設定網路連接性。Use SQL Server Configuration Manager to configure SQL Server services and configure network connectivity. 在 Windows 上執行的 configuration ManagerConfiguration Manager runs on Windows
mssql confmssql-conf 若要設定在 Linux 上執行的 SQL Server 使用 mssql conf。Use mssql-conf to configure SQL Server running on Linux.
SQL Server 移轉小幫手SQL Server Migration Assistant 使用 SQL Server 移轉小幫手將從 Microsoft Access、DB2、MySQL、Oracle 及 Sybase 到 SQL Server 的資料庫移轉作業自動化。Use SQL Server Migration Assistant to automate database migration to SQL Server from Microsoft Access, DB2, MySQL, Oracle, and Sybase.
Distributed ReplayDistributed Replay 使用 Distributed Replay 功能可協助您評估未來的 SQL Server 升級的影響。Use the Distributed Replay feature to help you assess the impact of future SQL Server upgrades. 也可以使用 Distributed Replay 協助評估硬體和作業系統升級與 SQL Server 微調的影響。Also use Distributed Replay to help assess the impact of hardware and operating system upgrades, and SQL Server tuning.
ssbdiagnosessbdiagnose Ssbdiagnose 公用程式會報告 Service Broker 交談中的 Service Broker 服務之組態的問題。The ssbdiagnose utility reports issues in Service Broker conversations or the configuration of Service Broker services.

命令列公用程式Command line utilities

命令列公用程式可編寫 SQL ServerSQL Server 作業指令碼。Command line 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. <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
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. <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 Agent。Used to start SQL ServerSQL Server Agent from a command prompt. <磁碟機>:\Program Files\Microsoft SQL Server\<執行個體名稱>\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. <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\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. <drive>:\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. <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

SQL 命令提示字元公用程式語法慣例SQL 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.