I am using DECS to connect to MS SQL 2000 (OLE DB). My sql tables use auto increment integers as key values. I would like to use notes to create a new record in sql, taking into account auto increment keys.
I have tried using a stored procedure to insert the record and then return the key as an output parameter, but it doesn’t seem to be supported in OLE DB (is it?)
I have also tried using the result set of a stored procedure but this doesn’t seem to work either.
Thanks in advance.
Subject: DECS
Identity columns (either in DB2 or SQL Server) are not supported as keyfields for DECS. The reason for this is that the key value is what links your Notes Document to you SQL Server table. When you create a record in Notes, and specify a keyfield, SQL Server will generate an error like so:
Cannot insert explicit value for identity column in table ‘incremental_key’ when IDENTITY_INSERT is set to OFF.
Now, if you try and create a record and leave the keyfield blank, the Notes document does not have a corresponding SQL Server record to “link” to.
Sarah