How to insert multiple rows into SQL Server Parallel Data Warehouse table

Viewed 9738

I am on PDW AU5 with SQL Server 2012 servers. I have an empty replicated table that I'm trying to load data into. I'm only loading 2 records. So, I'm doing:

INSERT INTO dbo.some_table
(Col1, Col2, Col3)
VALUES
(1, 'x', 'a'),
(2, 'y', 'b')

From the books online, this should work. (It works on SMP.) However, PDW throws an error stating: Parse error at line: 4, column: x: Incorrect syntax near ','.

The comma that this error is referring to is the one after the first tuple. What am I doing wrong? Is inserting multiple rows via INSERT INTO not allowed on AU5?

2 Answers

Using INSERT INTO and SELECT: If you have a very large number of rows to insert it can fail with Error:

Msg 102042, Level 16, State 1, Line 1    
The query processor ran out of stack space during query optimization. Please simplify the query.

The only alternative I have found is to insert each row individually as follows:

create table #A (ID integer, CollA varchar(10),  CollB Varchar(50))

Insert into #A values (2176035,'ADM1','DIFFERENT TO OPS1 APP')    
Insert into #A values (5530921,'ADM7','DIFFERENT TO OPS1 APP')    
Insert into #A values (5034949,'ADM7','DIFFERENT TO OPS1 APP')    
Insert into #A values (3780563,'ADM4','DIFFERENT TO OPS1 APP')    
Insert into #A values (5215169,'ADM2','DIFFERENT TO OPS1 APP')
Related