Discover this year's submissions to the Dataiku Frontrunner Awards and give kudos to your favorite use cases and success stories!READ MORE

SQL Merge command in SQL query

Solved!
MRvLuijpen
Neuron
Neuron
SQL Merge command in SQL query

Hello Community,

I was wondering if I could use the SQL MERGE command inside a DSS SQL Query recipe.

The structure of the Merge command is:

MERGE target_table
USING source_table ON merge_condition
WHEN MATCHED THEN update_statement
WHEN NOT MATCHED THEN insert_statement
WHEN NOT MATCHED BY SOURCE THEN DELETE;

See https://www.sqlservertutorial.net/sql-server-basics/sql-server-merge/ 

 

Thanks in advance.

0 Kudos
1 Solution
fchataigner2
Dataiker
Dataiker

Hi,

you cannot use MERGE inside a SQL Query recipe, but that should work inside a SQL Script recipe (the second option in the modal you get when you create a SQL recipe)

View solution in original post

2 Replies
fchataigner2
Dataiker
Dataiker

Hi,

you cannot use MERGE inside a SQL Query recipe, but that should work inside a SQL Script recipe (the second option in the modal you get when you create a SQL recipe)

MRvLuijpen
Neuron
Neuron
Author

Thank you for your response.

0 Kudos