cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

ThingWorx Navigate is now Windchill Navigate Learn More

Translate the entire conversation x

I´m trying take tags from datalogger to sql Server 2022 and gets duplicates id

VH_10682998
3-Newcomer

I´m trying take tags from datalogger to sql Server 2022 and gets duplicates id

VH_10682998_0-1746799381791.png

VH_10682998_1-1746799478139.png

VH_10682998_2-1746799507252.png

VH_10682998_3-1746799541565.png

 

 

ACCEPTED SOLUTION

Accepted Solutions

Hi,

 

You're getting duplicate rows in SQL Server because the trigger in your KEPServerEX DataLogger is staying TRUE for more than one scan cycle. While it's TRUE, the logger is recording the same data repeatedly.

To fix this, you can try one of the following:

  1. Set “Log All Items” to No so it only logs when the value changes.

  2. Change the trigger to create a short pulse—make the tag TRUE for one cycle only, then FALSE. This way, it logs only once per event.

  3. If you want to keep the current setup, add a timestamp or auto-increment column in SQL Server so each row is unique.

  4. You can also handle duplicates at the database level using a view or filtering logic.

The cleanest solution is to trigger logging with a short one-time TRUE condition or enable logging only on change.

 

Thanks,

Shashi Preetham,
+91 8099838001 | shashi@psptechhub.com,
PSPTechHub  ||  World of PTC Thingworx  ||  LinkedIn

View solution in original post

2 REPLIES 2

Hi,

 

You're getting duplicate rows in SQL Server because the trigger in your KEPServerEX DataLogger is staying TRUE for more than one scan cycle. While it's TRUE, the logger is recording the same data repeatedly.

To fix this, you can try one of the following:

  1. Set “Log All Items” to No so it only logs when the value changes.

  2. Change the trigger to create a short pulse—make the tag TRUE for one cycle only, then FALSE. This way, it logs only once per event.

  3. If you want to keep the current setup, add a timestamp or auto-increment column in SQL Server so each row is unique.

  4. You can also handle duplicates at the database level using a view or filtering logic.

The cleanest solution is to trigger logging with a short one-time TRUE condition or enable logging only on change.

 

Thanks,

Shashi Preetham,
+91 8099838001 | shashi@psptechhub.com,
PSPTechHub  ||  World of PTC Thingworx  ||  LinkedIn

Hi @VH_10682998,

 

I wanted to see if you got the help you needed.

If so, please mark the appropriate reply as the Accepted Solution. It will help other members who may have the same question.
Please note that industry experts also review the replies and may eventually accept one of them as solution on your behalf.
Of course, if you have more to share on your issue, please pursue the conversation. 

 

Thanks,
Anurag 

Announcements


Top Tags