使用 SQL Server Management Studio (SSMS) 连接到 Azure Synapse Analytics 中的专用 SQL 池(以前称为 SQL DW)Connect to a dedicated SQL pool (formerly SQL DW) in Azure Synapse Analytics with SQL Server Management Studio (SSMS)
使用 SQL Server Management Studio (SSMS) 连接并查询专用 SQL 池(以前称为 SQL DW)。Use SQL Server Management Studio (SSMS) to connect to and query a dedicated SQL pool (formerly SQL DW).
先决条件Prerequisites
要使用本教程,需要:To use this tutorial, you need:
- 现有专用 SQL 池。An existing dedicated SQL pool. 若要创建一个,请参阅创建专用 SQL 池(以前称为 SQL DW)。To create one, see Create a dedicated SQL pool (formerly SQL DW).
- 安装了 SQL Server Management Studio (SSMS)。SQL Server Management Studio (SSMS) installed. 免费下载 SSMS(如果尚未安装)。Download SSMS for free if you don't already have it.
- 完全限定的 SQL Server 名称。The fully qualified SQL server name. 若要查找此信息,请参阅专用 SQL 池(以前称为 SQL DW)。To find this information, see Dedicated SQL pool (formerly SQL DW).
1.连接到专用 SQL 池(以前称为 SQL DW)1. Connect to your dedicated SQL pool (formerly SQL DW)
打开 SSMS。Open SSMS.
选择“文件” > “连接对象资源管理器” ,打开对象资源管理器。Open Object Explorer by selecting File > Connect Object Explorer.
填写“连接到服务器”窗口中的字段。Fill in the fields in the Connect to Server window.
- 服务器名称。Server name. 输入前面标识的 服务器名称 。Enter the server name previously identified.
- 身份验证。Authentication. 选择“SQL Server 身份验证” 或“Active Directory 集成身份验证” 。Select SQL Server Authentication or Active Directory Integrated Authentication.
- “用户名” 和“密码” 。User Name and Password. 如果上面选择了 SQL Server 身份验证,请输入用户名和密码。Enter user name and password if SQL Server Authentication was selected above.
- 单击“连接” 。Click Connect.
要浏览,请展开 Azure SQL 服务器。To explore, expand your Azure SQL server. 可以查看与服务器关联的数据库。You can view the databases associated with the server. 展开 AdventureWorksDW 以查看示例数据库中的表。Expand AdventureWorksDW to see the tables in your sample database.
2.运行示例查询2. Run a sample query
现在,已建立了与数据库的连接,接下来让我们编写查询。Now that a connection has been established to your database, let's write a query.
在 SQL Server 对象资源管理器中右键单击数据库。Right-click your database in SQL Server Object Explorer.
选择“新建查询” 。Select New Query. 此时将打开一个新的查询窗口。A new query window opens.
将以下 T-SQL 查询复制到查询窗口中:Copy the following T-SQL query into the query window:
SELECT COUNT(*) FROM dbo.FactInternetSales;
单击
Execute
或使用以下快捷方式即可运行查询:F5
。Run the query by clickingExecute
or use the following shortcut:F5
.查看查询结果。Look at the query results. 在此示例中,FactInternetSales 表包含 60398 行。In this example, the FactInternetSales table has 60398 rows.
后续步骤Next steps
若要为 Azure Active Directory 身份验证配置环境,请参阅向 SQL 池进行身份验证。To configure your environment for Azure Active Directory authentication, see Authenticate to SQL pool.