Skip to main content
February 17, 2023
Question

Write Record where primary key is GUID unique identifier.

  • February 17, 2023
  • 8 replies
  • 0 views

Hi Everybody,

Has anyone had success implementing data synced record types on database tables that use GUID unique identifier as database fields?

In one of our example tables the primary key uses unique identifier. I can configure the data synced record type and perform full sync with the record. But when I use the Write Record smart service I get the following error.

Unable to write to the source due to system error.
Error Details: The generated key type is not supported. Unable to cast [null] to [java.lang.Number].

Workarounds involve using the Query Database smart service to execute SQL Statement for inserting then running the Sync Records service. But I feel like we are losing value having to resort to Query Database smart service.

Asking the community if there were any success stories using unique identifier data type with their data sync record types.

Thanks In Advance

    8 replies

    stefanhelzle0001
    February 18, 2023
    February 20, 2023

    Thank you for your suggestion Stefan. I should have mentioned that we are using Microsoft SQL Server as our database. The option to use a sequence for primary key generation isn't available.

    stewart.burchell
    February 20, 2023

    Sequence for primary key generation is available. Have I misunderstood what you meant?

    The MS SQL Server uses the IDENTITY keyword to perform an auto-increment feature. In the example above, the starting value for IDENTITY is 1, and it will increment by 1 for each new record. Tip: To specify that the "Personid" column should start at value 10 and increment by 5, change it to IDENTITY(10,5) .