问题
simple insert code but i keep getting syntax errors the values lines have a value for each column in the table, it only has 3 columns, i've tried removing the comma, tried using semi colon tried nothing after closing parent, tried explicitly stating column name before values nothing works on this simple bit of code
回答1:
Azure Synapse Analytics (formerly known as Azure SQL Data Warehouse) does not support the INSERT ... VALUES
clause for more than a single row. Simply convert these into a SELECT
with UNION ALL
, eg
INSERT INTO dbo.countryCurrency
SELECT 'Afganistan', 'Afghani', 'AFN'
UNION ALL
SELECT 'Aland Islands', 'Euro', 'EUR'
UNION ALL
SELECT 'Albania', 'Lek', 'ALL'
UNION ALL
SELECT 'Algeria', 'Algerian Dinar', 'DZD'
UNION ALL
SELECT 'American Samoa', 'US Dollar', 'USD'
-- ... etc
回答2:
The SQL Server table value constructor is not supported in Azure Synapse, see https://docs.microsoft.com/en-us/sql/t-sql/queries/table-value-constructor-transact-sql.
来源:https://stackoverflow.com/questions/62349792/insert-on-synapse-dw-in-ssms