This is an example of a problem I am having when inserting records. I have a table called Person with a primary key called person_id. In SQL Server person_id is set up as an identify column. Here is the query object setup:
Code: Select all
SQL: SELECT * FROM person
SQLInsert: INSERT INTO person (person_id, name) VALUES (:PERSON_ID, :NAME)
SQLRefresh: WHERE person_id = :PERSON_ID
KeyFields = person_id
Options.RefreshOptions = roAfterInsert
Options.ReturnParams = True
Options.RequiredFields = False
Code: Select all
SpecificOptions.Oracle.KeySequence = person_seq
But connected SQL Server, when posting an inserted record, I get an error that says "cannot insert explicit value for identity column in table person when identity_insert is set to OFF".
Is there a way to insert into a table with an identity column in SQL Server so that the UniDac query object behaves the same as the Oracle insertion (refreshing after insert) without needing to change the queries?