You can write job results directly to your SQL Server tables.
For sample workflows on exporting to your SQL Server tables, view Treasure Boxes.
Basic knowledge of Treasure Data.
A SQL Server instance.
Use the TD Console to Export Results
Open the TD Console.
Navigate to Data Workbench > Queries.
Create a new query or select an existing query.
Select Export Results.
The Choose Integration dialog opens. Select one of two options:
Use Existing Integration. Select the existing integration.
Create New Integration. Select the integration type and edit the integration Name, Host, User, and Password.
If you are using Azure, omit the instance name and provide the port # only.
If you are not using Azure and want to use your own instance: make sure that you can connect to the database using only the instance name, without the port. The reason for this is that when port is set, the instance name will be ignored. The `JDBC` library does not try to resolve from name → port but instead uses the port in configuration. Check with a database connector tool without using the given port.
Save the query with a name and run, or just run the query. After successful completion of the query, the results are exported to the specified SQL Server destination.
Use from CLI
The following command enables you to set a scheduled query with Result Output to SQL Server.
Designate your json_key and escape newline with backslash.
FAQ for Microsoft SQL Server Result Output
MS SQL Server Result Output fails with “Connection reset” failure while exporting to Azure SQL Database
Azure SQL Database is a multitenant service. Timeout sometimes occurs due to resource problems. To avoid this problem, we recommend you to try the following workarounds:
First dump to Azure Blob Storage with [Azure Blob Storage Data Result Output](/articles/result-into-microsoft-azure-blob-storage), then export to Azure SQL Database.
Decrease `batch_size` option's value like 3000 to reduce byte size of every insert request. Note that this change may cause long job running time.