cancel
Showing results for 
Search instead for 
Did you mean: 

Update SQL Server table with complex update statement

sg_dev
New Contributor

We have a specific requirement where we need to import some data from several sources (example: Snowflake) and load them in SQL Server on premise table. Once that is done, some of the columns of the SQL Server table should be updated. This update statement involves several tables (using join condition) and some filters, which makes the update condition a complicated one.

But from the documentation, "SQL Server - Update" supports only simple update statement. I have also tried "SQL Server - Execute" Snap. As per documentation "SQL Server - Execute" is recommended for single queries, but my update statement is a complex query involving several tables and joins. Can you please let me know how I can execute this update statement in Snaplogic.

Note: Although as per documentation "We recommend you to add a single query in the SQL Statement field", I used that query in "SQL Server - Execute" Snap. But that took hours to update only 2000 records.

1 REPLY 1

manichandana_ch
New Contributor III

Hi sg_dev,

In the SQL Account being used in the SQL Server execute snap, please try edit account and under the Advanced properties, check the batch size(usually 50) and try increasing it to a higher number. That should reduce the time taken.

Thanks !

 

manichandana_ch_1-1695966490885.png