Our Brands

Welcome to the Schneider Electric Website

Welcome to our website.
		
How can we help you today?
Cannot Insert Duplicate Key

Issue

SQL Server Management Studio throws the following error when assigning data to a location where data already exists, ex. reassigning data to a source that is already populated when performing the functions in How to move historical data from an existing device to another device in Power Monitoring Expert | Schneider Electric USA

"Cannot insert duplicate key row in object 'dboDataLog2' with unique index 'CIX_DataLog2_SourceID_QuantityID_TimestampUTC'. The duplicate key value is (...)"

error

Product Line

Power Monitoring Expert 2020

Power Monitoring Expert 2021

Power Monitoring Expert 2022

Power Monitoring Expert 2023

Power Monitoring Expert 2024

Environment

Microsoft SQL Server Management Studio

Cause

The device to which data is being assigned already has existing entries for the specific time stamps included in the script. This may happen due to an overlap in time between disabling and enabling the two devices that data is being transferred between. In the following example the error is seen when trying to insert data to the source in the first column from 1/28/2025 8:15:00 AM onwards.

data

Resolution

Be sure to take an updated backup of the ION_Data database before making these changes

Remove the existing data, which is unwanted and intended to be replaced by using the following scripts, use desired SourceID (verify from [ION_Data].[dbo].[Source]) and TimestampUTC based on the system.

DELETE FROM [ION_Data].[dbo].[DataLog2] where SourceID = 9 and QuantityID = 69 and TimestampUTC > '2022-09-14' and TimestampUTC <  '2022-09-15'

Proceed with https://www.se.com/us/en/faqs/FA271539/

Schneider Electric Philippines

Cannot Insert Duplicate Key

Issue

SQL Server Management Studio throws the following error when assigning data to a location where data already exists, ex. reassigning data to a source that is already populated when performing the functions in How to move historical data from an existing device to another device in Power Monitoring Expert | Schneider Electric USA

"Cannot insert duplicate key row in object 'dboDataLog2' with unique index 'CIX_DataLog2_SourceID_QuantityID_TimestampUTC'. The duplicate key value is (...)" 

error

Product Line

Power Monitoring Expert 2020

Power Monitoring Expert 2021

Power Monitoring Expert 2022

Power Monitoring Expert 2023

Power Monitoring Expert 2024

 

Environment

Microsoft SQL Server Management Studio

 

Cause

The device to which data is being assigned already has existing entries for the specific time stamps included in the script. This may happen due to an overlap in time between disabling and enabling the two devices that data is being transferred between. In the following example the error is seen when trying to insert data to the source in the first column from 1/28/2025 8:15:00 AM onwards. 

data

 

Resolution

Be sure to take an updated backup of the ION_Data database before making these changes

Remove the existing data, which is unwanted and intended to be replaced by using the following scripts, use desired SourceID (verify from [ION_Data].[dbo].[Source]) and TimestampUTC based on the system. 

 

DELETE FROM [ION_Data].[dbo].[DataLog2] where SourceID = 9 and QuantityID = 69 and TimestampUTC > '2022-09-14' and TimestampUTC <  '2022-09-15'

 

Proceed with https://www.se.com/us/en/faqs/FA271539/

 

 

 

 

Schneider Electric Philippines

Explore more
Range:
Explore more
Range:
Users group

Discuss this topic with experts

Visit our community and get advice from experts and peers on this topic and more
Users group

Discuss this topic with experts

Visit our community and get advice from experts and peers on this topic and more
Explore more
Range:
Explore more
Range:

Need help?

  • Start here!

    Find answers now. Search for a solution on your own, or connect with one of our experts.

  • Contact Support

    Reach out to our customer care team to receive more information, technical support, assistance with complaints and more.

  • Where to buy?

    Easily find the nearest Schneider Electric distributor in your location.

  • Search FAQs

    Search topic-related frequently asked questions to find answers you need.

  • Contact Sales

    Start your sales inquiry online and an expert will connect with you.

I'd like to receive news and commercial info from Schneider Electric and its affiliates via electronic communication means such as email, and I agree to the collection of information on the opening and clicks on these emails (using invisible pixels in the images), to measure performance of our communications and improve them. For more details, please read our Privacy Policy.

  • Products Documentation
  • Software Downloads
  • Product Selector
  • Product Substitution and Replacement
  • Help and Contact Center
  • Find our Offices
  • Get a Quote
  • Where to buy
  • Careers
  • Company Profile
  • Report a misconduct
  • Accessibility
  • Newsroom
  • Investors
  • EcoStruxure
  • Job Search
  • Blog
  • Privacy Policy
  • Cookie Notice
  • Terms of use
  • Change your cookie settings
Your browser is out of date and has known security issues.

It also may not display all features of this website or other websites.

Please upgrade your browser to access all of the features of this website.

Latest version for Google Chrome, Mozilla Firefox or Microsoft Edgeis recommended for optimal functionality.