# JDBC sink connector with nested JSON for SQL server

**URL:** <https://forum.confluent.io/t/jdbc-sink-connector-with-nested-json-for-sql-server/2795>\
**Category:** Kafka Connect\
**Created:** [16 September 2021 15:51 UTC](https://forum.confluent.io/t/jdbc-sink-connector-with-nested-json-for-sql-server/2795 "2021-09-16T15:51:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![shubhamshirur](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@shubhamshirur](https://forum.confluent.io/u/shubhamshirur)\
**Post date:** [16 September 2021 15:51 UTC](https://forum.confluent.io/t/jdbc-sink-connector-with-nested-json-for-sql-server/2795/1 "2021-09-16T15:51:56Z")

</div>

Hey, I am using JDBC sink connector and want to put nested JSON data in SQL server from Kafka topic. Do I need to flatten it using SMT in this case or there is any other ideal way to deal with?

Thank you.

---

<div class="post-metadata">

**Author:** ![danicafine](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/danicafine/32/2995_2.png) [@danicafine](https://forum.confluent.io/u/danicafine)\
**Post date:** [16 September 2021 17:20 UTC](https://forum.confluent.io/t/jdbc-sink-connector-with-nested-json-for-sql-server/2795/2 "2021-09-16T17:20:33Z")

</div>

Hi there! I’d personally use the [flatten SMT](https://docs.confluent.io/platform/current/connect/transforms/flatten.html#flatten) and then rename fields as necessary (using [rename SMT](https://docs.confluent.io/platform/current/connect/transforms/replacefield.html#rename-a-field)) before putting in the database. For more control, you can certainly also implement a streaming application to do these transformation for you. But it depends on your needs.

---

<div class="post-metadata">

**Author:** ![SarathBaiju](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/sarathbaiju/32/1179_2.png) [@SarathBaiju](https://forum.confluent.io/u/SarathBaiju)\
**Post date:** [4 October 2021 08:41 UTC](https://forum.confluent.io/t/jdbc-sink-connector-with-nested-json-for-sql-server/2795/3 "2021-10-04T08:41:57Z")

</div>

@danicafine how we can specify more than one transform in a connector configuration?

i am attaching one sample below, is it correct?  
“transforms”: “flatten,RenameField”,  
“transforms.flatten.type”: “org.apache.kafka.connect.transforms.Flatten$Value”,  
“transforms.flatten.delimiter”: “\_”,  
“transforms.RenameField.type”: “org.apache.kafka.connect.transforms.ReplaceField$Value”,  
“transforms.RenameField.renames”: “After\_Name:Name”

---

<div class="post-metadata">

**Author:** ![danicafine](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/danicafine/32/2995_2.png) [@danicafine](https://forum.confluent.io/u/danicafine)\
**Post date:** [4 October 2021 17:25 UTC](https://forum.confluent.io/t/jdbc-sink-connector-with-nested-json-for-sql-server/2795/4 "2021-10-04T17:25:26Z")

</div>

Yes, you have the right idea! This [blog](https://www.confluent.io/blog/kafka-connect-single-message-transformation-tutorial-with-examples/#transformations) explains it a little more formally.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/confluentcommunity/original/1X/c49438c90c9df282e9996fdf6971be890c71b65a.svg) [@system](https://forum.confluent.io/u/system)\
**Post date:** [3 November 2021 17:25 UTC](https://forum.confluent.io/t/jdbc-sink-connector-with-nested-json-for-sql-server/2795/5 "2021-11-03T17:25:28Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
