管理服务器和见解小组件中使用的数据库 Azure Data StudioAzure Data StudioManage servers and databases with Insight widgets in Azure Data StudioAzure Data Studio

见解小组件需要使用来监视服务器和数据库的 TRANSACT-SQL (T-SQL) 查询并将其转换为见解深刻的可视化效果。Insight widgets take the Transact-SQL (T-SQL) queries you use to monitor servers & databases and turns them into insightful visualizations.

Insights 是可自定义图表和图形添加到服务器和数据库监视仪表板。Insights are customizable charts and graphs that you add to server and database monitoring dashboards. 查看一眼见解的服务器和数据库,然后深入了解更多详细信息,并启动的已定义的管理操作。View at-a-glance insights of your servers and databases, then drill into more details, and launch management actions that you define.

您可以构建令人惊叹服务器和数据库管理仪表板类似于下面的示例:You can build awesome server and database management dashboards similar to the following example:

数据库仪表板

若要在跳转,并开始创建不同类型的见解小组件,请查看以下教程:To jump in and start creating different types of insight widgets, check out the following tutorials:

SQL 查询SQL Queries

Azure Data StudioAzure Data Studio 尝试避免引入但另一个语言或大量用户界面以便尝试使用 T-SQL 尽可能多地使用最小 JSON 配置。tries to avoid introducing yet another language or heavy user interface so it tries to use T-SQL as much as possible with minimal JSON configuration. 使用 T-SQL 配置见解小组件利用无数的现有源的查询可以转换为见解深刻的小组件的非常有用的 T-SQL 查询数。Configuring insight widgets with T-SQL leverages the countless number of existing sources of useful T-SQL queries that can be turned into insightful widgets.

见解小组件组成一个或两个 T-SQL 查询:Insight widgets are composed of one or two T-SQL queries:

  • 见解小组件查询是必需的并且是在小组件中返回显示的数据的查询。Insight widget query is mandatory, and is the query that returns the data that appears in the widget.
  • 了解详细信息查询是仅在需要创建一个了解详细信息页。Insight details query is only required if you are creating an insight details page.

见解小组件查询定义呈现计数、 图表或图形的数据集。An insight widget query defines a dataset that renders a count, chart, or graph. 了解详细信息查询用于列出相关的见解以了解详细信息面板中的表格格式的详细信息。Insight details query is used to list relevant insight detail information in a tabular format in the insight details panel.

Azure Data StudioAzure Data Studio 执行见解小组件查询并将查询结果集映射到图表的数据集,然后将其呈现。executes insight widget queries and maps the query result set to a chart's dataset then renders it. 当用户打开了某个见解的详细信息时,它执行了解详细信息查询,并打印出在对话框中的网格视图中的结果。When users open up an insight's details, it executes the insight details query and prints out the result in a grid view within the dialog.

基本理念是一种方法中编写 T-SQL 查询,以便它可以用作数据集的计数、 图表和图形小组件。The basic idea is to write a T-SQL query in a way so it can be used as a dataset of a count, chart, and graph widget.

“摘要”Summary

T-SQL 查询,其结果集确定见解小组件行为。The T-SQL query and its result set determine the insight widget behavior. 编写查询的图表类型或映射正确的图表类型的现有查询是关键的考虑因素,以生成有效的见解小组件。Writing a query for a chart type or mapping a right chart type for existing query is the key consideration to build an effective insight widget.

其他资源Additional resources