Search code examples
delphitmstms-web-corestellar-datastore

Cannot insert explicit value for identity column in stellards.io


I'm using the import tool (Written in Delphi) from stellards.io and I'm trying to import a CSV file into my database, but I keep getting the following error:

ERROR: Cannot insert explicit value for identity column in table '441' when IDENTITY_INSERT is set to OFF.

So how/where can I set my IDENTITY_INSERT to ON?


When inserting data into this table in my own project using a TWebStellarDataStoreClientDataset component in a TWebDBGrid and TWebDBNavigator, then it kind of works and I don't see such an error. It simply just ignores the value I give for the id field and there's no error.

But obviously, this doesn't solve my issue as I want to be able to insert my own id for the field.

So I need to set IDENTITY_INSERT to ON so that I can import and save my own id for some of the rows in the table.


How/Where can I set IDENTITY_INSERT to ON for my Stellar Datastore tables?


Solution

  • I ended up contacting TMS Software regarding this and this is the response:

    This functionality (setting IDENTITY_INSERT to ON) is not currently exposed and available in Stellar DataStore. The service watches over the id and its integrity at all times.

    So as of right now, it's not possible to set my IDENTITY_INSERT to ON.

    So I can't insert my own values into the id field. You'll need to let StellarDS manage and handle the id field solely.