# Jdbc connector - limit varchars for sink process

**URL:** <https://forum.confluent.io/t/jdbc-connector-limit-varchars-for-sink-process/2901>\
**Category:** Kafka Connect\
**Created:** [28 September 2021 08:13 UTC](https://forum.confluent.io/t/jdbc-connector-limit-varchars-for-sink-process/2901 "2021-09-28T08:13:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![KevinBegrow](https://avatars.discourse-cdn.com/v4/letter/k/dfb087/32.png) [@KevinBegrow](https://forum.confluent.io/u/KevinBegrow)\
**Post date:** [28 September 2021 08:13 UTC](https://forum.confluent.io/t/jdbc-connector-limit-varchars-for-sink-process/2901/1 "2021-09-28T08:13:58Z")

</div>

Hello,  
I facing a performance issues when writing to a MSSQL cluster with jdbc sink connector.  
The issue is located in the fact that there is a “string” as part of the PK. (I have tested it without this value and it was super fast)

Doing some query analyses it turned out the connector is writing all strings as nvarchar(4000). This leads in some performance issues. Is there anyway (transform etc) to limit a string?

The customer\_id unfortunately is based on a md5hash so I can’t CAST it to integer etc.

A workaround would be to use another field as PK tho. Nevertheless I would like to stick to this PK if possible.

Thanks for your help in advance.

---

<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:** [28 October 2021 08:14 UTC](https://forum.confluent.io/t/jdbc-connector-limit-varchars-for-sink-process/2901/2 "2021-10-28T08:14:32Z")

</div>

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