Create a new configuration of the Synapse writer. Start with setting up database credentials and provide a host name, port, user name, password, database name, and a schema.
We highly recommend that you create dedicated credentials for the writer.
First, create a login in the
sqlcmd -S hostname -U user -P password -d master -I
Then connect to your database (not master). Synapse doesn’t support database switching.
sqlcmd -S hostname -U user -P password -d database -I
Continue by creating a user and granting the permissions:
The next step is to configure the tables to write.
Click the Add Table button:
Select an existing table from Storage:
Then specify the table configuration. Use the preview icon to peek at the column contents.
For each column you can specify its
IGNOREmeans that the column will not be present in the destination table.
'') in that column will be converted to
NULL. Use this for non-string columns with missing data.
When done configuring the columns, don’t forget to save the settings.
At the top of the page, you can specify the target table name and additional load options. There are two main options how the writer can write data to tables — Full Load and Incremental Load.
In the Incremental Load mode, the data are bulk inserted into the destination table and the table structure must match (including the data types). That means the structure of the target table will not be modified. If the target table doesn’t exist, it will be created. If a primary key is defined on the table, the data is upserted. If no primary key is defined, the data is inserted.
In the Full Load mode, the table is completely overwritten including the table structure. The table is removed
and is recreated. The
DROP command needs to acquire
a table-level lock.
This means that if the database is used by other applications which acquire table-level locks, the writer may
freeze waiting for the locks to be released.
Additionally, you can specify a Primary key of the table, a simple column Data filter, and a filter for incremental processing.