Polybase SQL 容器中的 Server 2019 到 SQL Server 2019 OnPremise - 插入外部 table 不工作
Polybase SQL Server 2019 in Container to SQL Server 2019 OnPremise - Insert into external table not working
我在启用了 polybase 的 Docker 容器中安装了 SQL Server 2019,我正在连接到启用了 polybase 的 SQL Server 2019 On Premise。我在 Docker -SQL 服务器中创建了外部 table。
我还允许 polybase 导出,重新启动了本地 sql 服务器 2019。
EXEC sp_configure 'allow polybase export', 1;
RECONFIGURE
SELECT 工作正常。但是当我尝试插入
INSERT INTO Student
select 3, 'Amaya', 'A+'
错误:
Started executing query at Line 53
Msg 46519, Level 16, State 16, Line
DML Operations are not supported with external tables.
Total execution time: 00:00:00.107
外部表是只读的。正如错误告诉您的那样,您不能对它们执行 DML 操作(例如 SELECT
、UPDATE
等)。
文章CREATE EXTERNAL TABLE (Transact-SQL): Limitations and Restrictions:
中也记录了这一点
Only these Data Definition Language (DDL) statements are allowed on external
tables:
- CREATE TABLE and DROP TABLE
- CREATE STATISTICS and DROP STATISTICS
- CREATE VIEW and DROP VIEW
Constructs and operations not supported:
- The DEFAULT constraint on external table columns
- Data Manipulation Language (DML) operations of delete, insert, and update
强调我的。
我在启用了 polybase 的 Docker 容器中安装了 SQL Server 2019,我正在连接到启用了 polybase 的 SQL Server 2019 On Premise。我在 Docker -SQL 服务器中创建了外部 table。
我还允许 polybase 导出,重新启动了本地 sql 服务器 2019。
EXEC sp_configure 'allow polybase export', 1;
RECONFIGURE
SELECT 工作正常。但是当我尝试插入
INSERT INTO Student
select 3, 'Amaya', 'A+'
错误:
Started executing query at Line 53
Msg 46519, Level 16, State 16, Line
DML Operations are not supported with external tables.
Total execution time: 00:00:00.107
外部表是只读的。正如错误告诉您的那样,您不能对它们执行 DML 操作(例如 SELECT
、UPDATE
等)。
文章CREATE EXTERNAL TABLE (Transact-SQL): Limitations and Restrictions:
中也记录了这一点Only these Data Definition Language (DDL) statements are allowed on external
tables:
- CREATE TABLE and DROP TABLE
- CREATE STATISTICS and DROP STATISTICS
- CREATE VIEW and DROP VIEW
Constructs and operations not supported:
- The DEFAULT constraint on external table columns
- Data Manipulation Language (DML) operations of delete, insert, and update
强调我的。