insert on synapse DW in ssms

非 Y 不嫁゛ 提交于 2021-02-10 15:11:04

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!