# Problem when use ElasticSearch with SQLServer

**URL:** <https://discuss.elastic.co/t/problem-when-use-elasticsearch-with-sqlserver/205624>\
**Category:** Logstash\
**Created:** [October 29, 2019, 9:35am UTC](https://discuss.elastic.co/t/problem-when-use-elasticsearch-with-sqlserver/205624 "2019-10-29T09:35:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hoang\_Nguyen1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hoang_nguyen1/32/56760_2.png) [@Hoang\_Nguyen1](https://discuss.elastic.co/u/Hoang_Nguyen1)\
**Post date:** [October 29, 2019, 9:35am UTC](https://discuss.elastic.co/t/problem-when-use-elasticsearch-with-sqlserver/205624/1 "2019-10-29T09:35:14Z")

</div>

I don't know whether when we update data in SqlServer to ES by Logstash, ES will reindex all or not ?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 29, 2019, 10:00am UTC](https://discuss.elastic.co/t/problem-when-use-elasticsearch-with-sqlserver/205624/2 "2019-10-29T10:00:31Z")

</div>

Welcome!

I moved your question to #logstash.

The jdbc input plugin runs the query you defined. If the query does not include any timestamp like `SELECT * FROM TABLE`, then everything gets read again and reindexed.

Have a look at [https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html#\_state](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html#_state) to see how you can use a column to read only the last changes, supposing that you have this information in your tables.

---

<div class="post-metadata">

**Author:** ![Hoang\_Nguyen1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hoang_nguyen1/32/56760_2.png) [@Hoang\_Nguyen1](https://discuss.elastic.co/u/Hoang_Nguyen1)\
**Post date:** [October 30, 2019, 3:46am UTC](https://discuss.elastic.co/t/problem-when-use-elasticsearch-with-sqlserver/205624/3 "2019-10-30T03:46:17Z")

</div>

Okay I got it. Thank you very much. It's useful for me

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 27, 2019, 3:46am UTC](https://discuss.elastic.co/t/problem-when-use-elasticsearch-with-sqlserver/205624/4 "2019-11-27T03:46:28Z")

</div>

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