Consider this table:
CREATE TABLE t (i int, j int, ...);
I want to insert data into a table from a set of SELECT
statements. The simplified version of my query is:
INSERT INTO t VALUES ((SELECT 1), (SELECT 2), ...);
The real query can be much more complex, and the individual subqueries independent. Unfortunately, this standard SQL statement (which works on SQL Server) doesn't work on SQL Data Warehouse. The following error is raised:
Failed to execute query. Error: Insert values statement can contain only constant literal values or variable references.
Is there a way to work around this?
CREATE TABLE
statement just for illustration purposes to document the schema. I've changed the question to clarify this. – Cornaceous