Writing Job Results into SQL Server tables

This article explains how to write job results directly to your SQL Server tables.

Table of Contents

Prerequisites

  • Basic knowledge of Treasure Data, including the toolbelt.
  • A SQL Server instance.

Usage

Use from Web Console

Write the query

Please visit the Treasure Data Console query editor page and compile your query.

Specify the Result Export target

In the same window, click the Add button in the Result Export section and select Microsoft SQL Server from the drop down menu. Please fill out all the information below, including your JSON Credential, Bucket name, and Path:



Execute the query

Finally, either save the query with a name and run or just run the query. Upon successful completion of the query, its result will be automatically imported to the specified SQL Server destination:

Use from CLI

The following command is allow to set a sheduled query with Result Output to SQL Server.

Untitled-3
Please designate your json_key and escape newline with backslash.

For example,

$ td sched:create scheduled_sqlserver "10 6 * * *" \
-d dataconnector_db "SELECT id,account,purchase,comment,time FROM payment_history" \
-r '{
  "type":"sqlserver",
  "user":"user",
  "database":"mydb",
  "table":"payments",
  "batch_size":16777216,
  "mode":"insert"
}'

Last modified: Feb 24 2017 09:41:25 UTC

If this article is incorrect or outdated, or omits critical information, please let us know. For all other issues, please see our support channels.