# Update strategy for SQL server into elastic search

**URL:** <https://discuss.elastic.co/t/update-strategy-for-sql-server-into-elastic-search/199309>\
**Category:** Logstash\
**Created:** [September 12, 2019, 6:23pm UTC](https://discuss.elastic.co/t/update-strategy-for-sql-server-into-elastic-search/199309 "2019-09-12T18:23:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonakirke94](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@jonakirke94](https://discuss.elastic.co/u/jonakirke94)\
**Post date:** [September 12, 2019, 6:23pm UTC](https://discuss.elastic.co/t/update-strategy-for-sql-server-into-elastic-search/199309/1 "2019-09-12T18:23:42Z")

</div>

Hi everyone.

I'm trying to code along this [guide]( [guide https://www.elastic.co/blog/how-to-keep-elasticsearch-synchronized-with-a-relational-database-using-logstash](https://www.elastic.co/blog/how-to-keep-elasticsearch-synchronized-with-a-relational-database-using-logstash)) but doing it in MSSQL

First off there is no UNIX\_TIMESTAMP() function in SQL so I initially tried this  
DATEDIFF\_BIG(SECOND,'1970-01-01', modification\_time) AS unix\_ts\_in\_secs

This however doesn't work because a timestamp (synonym to rowversion) is not possible to convert to a time in SQL..

So here I am wondering how I can make a similiar approach in SQL as shown in the guide.

Thanks in advance

---

<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:** [October 10, 2019, 6:24pm UTC](https://discuss.elastic.co/t/update-strategy-for-sql-server-into-elastic-search/199309/2 "2019-10-10T18:24:09Z")

</div>

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