Skip to content

Commit ed99e67

Browse files
committed
Learn Editor: Update copy-into-transact-sql.md
1 parent 92cd5e1 commit ed99e67

File tree

1 file changed

+36
-4
lines changed

1 file changed

+36
-4
lines changed

docs/t-sql/statements/copy-into-transact-sql.md

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -629,9 +629,6 @@ When a column list isn't specified, COPY maps columns based on the source and ta
629629

630630
#### *External location*
631631

632-
> [!NOTE]
633-
> [Fabric OneLake](/fabric/onelake/onelake-overview) paths are currently not supported, only BLOB and ADLS Gen2 storage accounts are supported.
634-
635632
Specifies where the files containing the data is staged. Currently Azure Data Lake Storage (ADLS) Gen2 and Azure Blob Storage are supported:
636633

637634
- *External location* for Blob Storage: `https://<account\>.blob.core.windows.net/<container\>/<path\>`
@@ -802,6 +799,16 @@ Parser version 1.0 is available for backward compatibility only, and should be u
802799
> [!NOTE]
803800
> *MATCH_COLUMN_COUNT* works independently from *MAXERRORS*. A column count mismatch causes `COPY INTO` to fail regardless of *MAXERRORS*.
804801
802+
## Using COPY INTO with OneLake (Public Preview)
803+
You can now use `COPY INTO` to load data directly from files stored in **OneLake**, specifically from the **Files folder** of a Lakehouse. This eliminates the need for external staging accounts (such as ADLS Gen2 or Blob Storage) and enables workspace-governed, SaaS-native ingestion using Fabric permissions.
804+
805+
This functionality supports:
806+
- Reading from `Files` folders in Lakehouses
807+
- Workspace-to-Warehouse loads within the same tenant
808+
- Native identity enforcement using Microsoft Entra ID
809+
> [!NOTE]
810+
> This feature is currently in Public Preview.
811+
805812
## Permissions
806813

807814
### Control plane permissions
@@ -821,14 +828,28 @@ GO
821828
GRANT INSERT to [mike@contoso.com];
822829
GO
823830
```
824-
825831
> [!NOTE]
826832
> When using the *ErrorFile* option, the user must have the minimal permission of Blob Storage Contributor on the Storage Account container.
827833
834+
> [!NOTE]
835+
> When using OneLake as the source (Public Preview), the user must have **Contributor** or higher permissions on both the **source workspace** (where the Lakehouse is located) and the **target workspace** (where the Warehouse resides).
836+
> All access is governed via Microsoft Entra ID and Fabric workspace roles.
837+
828838
## Remarks
829839

830840
The COPY statement accepts only UTF-8 and UTF-16 valid characters for row data and command parameters. Source files or parameters (such as ROW TERMINATOR or FIELD TERMINATOR) that use invalid characters may be interpreted incorrectly by the COPY statement and cause unexpected results such as data corruption, or other failures. Make sure your source files and parameters are UTF-8 or UTF-16 compliant before you invoke the COPY statement.
831841

842+
## Limitations for OneLake as source (Public Preview)
843+
844+
- **Only Microsoft Entra ID authentication is supported.** Other authentication methods, such as SAS tokens, shared keys, or connection strings, are not permitted.
845+
846+
- **Only the `Files` folder of a Lakehouse is supported as a source.** Access to subfolders, shortcuts, or other OneLake locations is not currently available.
847+
848+
- **OneLake paths must use workspace and warehouse IDs.** Friendly names for workspaces or Lakehouses are not supported at this time.
849+
850+
- **Contributor permissions are required on both workspaces.** The executing user must have at least Contributor role on the source Lakehouse workspace and the target Warehouse workspace.
851+
852+
832853
## Examples
833854

834855
For more information on using COPY INTO on your [!INCLUDE [fabricdw](../../includes/fabric-dw.md)] in [!INCLUDE [fabric](../../includes/fabric.md)], see [Ingest data into your [!INCLUDE [fabricdw](../../includes/fabric-dw.md)] using the COPY statement](/fabric/data-warehouse/ingest-data-copy).
@@ -931,6 +952,17 @@ WITH (
931952
)
932953
```
933954

955+
### F. Load data from OneLake (Public Preview)
956+
957+
```sql
958+
COPY INTO t1
959+
FROM 'https://onelake.dfs.fabric.microsoft.com/<workspaceId>/<lakehouseId>/Files/*.csv'
960+
WITH (
961+
FILE_TYPE = 'CSV',
962+
FIRSTROW = 2
963+
);
964+
```
965+
934966
## FAQ
935967

936968
### What is the file splitting guidance for the COPY command loading compressed CSV files?

0 commit comments

Comments
 (0)