This question is locked. New answers and comments are not allowed.
Hi,
I have code to copy database records from one database to another. The records have database maintained integer keys.
Even though I copy the ID field from source to destination record, the destination context.add funciton is replacing the key with a new higher valued key.
If I was doing this in dynamic SQL, against a SQL Server database, I could use ExecuteNonQuery("DBCC CHECKIDENT ... to set the next key, however this is not supported in SQL Azure.
The next option is SET IDENTIY <tablename> ON, but then, how do I get OpenAccess to pass the key field on the insert statement?
I want to change this dynamically, since the on-going CRUD operations work as desired, and it is a special case, when I am refreshing or copying a database, that I want to keep the identity keys matching the source database.
Is there a way to do this in OpenAccess?
Thanks,
- Jim
I have code to copy database records from one database to another. The records have database maintained integer keys.
Even though I copy the ID field from source to destination record, the destination context.add funciton is replacing the key with a new higher valued key.
If I was doing this in dynamic SQL, against a SQL Server database, I could use ExecuteNonQuery("DBCC CHECKIDENT ... to set the next key, however this is not supported in SQL Azure.
The next option is SET IDENTIY <tablename> ON, but then, how do I get OpenAccess to pass the key field on the insert statement?
I want to change this dynamically, since the on-going CRUD operations work as desired, and it is a special case, when I am refreshing or copying a database, that I want to keep the identity keys matching the source database.
Is there a way to do this in OpenAccess?
Thanks,
- Jim