教程:使用 T-SQL 将数据加载到仓库
适用于:✅Microsoft Fabric 中的仓库
本教程介绍如何使用 T-SQL 将数据从公共存储 Azure Blob 存储帐户加载到仓库表中。
使用 T-SQL 加载数据
在此任务中,了解如何使用 T-SQL 加载数据。
请确保在 第一个教程中创建的工作区 处于打开状态。
在“主页”功能区上,选择“新建 SQL 查询”。
在查询编辑器中粘贴以下代码。 该代码将数据从 Azure Blob 存储帐户源的 Parquet 文件复制到
dimension_city
表和fact_sale
表中。--Copy data from the public Azure storage account to the dimension_city table. COPY INTO [dbo].[dimension_city] FROM 'https://fabrictutorialdata.blob.core.windows.net/sampledata/WideWorldImportersDW/tables/dimension_city.parquet' WITH (FILE_TYPE = 'PARQUET'); --Copy data from the public Azure storage account to the fact_sale table. COPY INTO [dbo].[fact_sale] FROM 'https://fabrictutorialdata.blob.core.windows.net/sampledata/WideWorldImportersDW/tables/fact_sale.parquet' WITH (FILE_TYPE = 'PARQUET');
在查询设计器功能区上,选择 运行 来执行查询。
完成脚本执行后,查看消息以确定
dimension_city
和fact_sale
表中加载的行数。若要加载已加载数据的预览,请在 资源管理器 窗格中,选择
fact_sale
。将查询重命名为
Load Tables
。