Axapta Database - RECID issue

  • Hello all,

    I am running a transfer of data into Axapta 4.0, and am experiencing an issue whereby the RECID field on the EMPLTABLE keeps returning the error;

    Server: Msg 515, Level 16, State 2, Line 4

    Cannot insert the value NULL into column 'RECID', table 'Cutover.dbo.EMPLTABLE'; column does not allow nulls. INSERT fails.

    The statement has been terminated.

    I have not actually specified the RECID with any value as it is a system generated number.

    My query is as follows:

    INSERT INTO Empltable (emplid, firstname, lastname, salary, positionstartdate, ccdescription, dimension, dimension2_, dataareaid)

    select * FROM OPENQUERY (persq1ttat, 'select * from CutoverTransfer')

    I have set up a linked server "persq1ttat" and the corresponding data is only going into the series of fields as above. All other default values can be entered without any issues, but I am having a particular issue with the RECID.

    I know that when I run an Excel import into Axapta that the system generates the RECID for each record, but that is going via the client as opposed to the back end database.

    Does anyone know how to generate a sequential RECID so I can insert the records from the other server?

    Or do you know how to run an insert without getting the RECID error?

    Many thaniks in advance for any responses. 🙂

  • Have a look at the Microsoft Dynamics AX Implementation Guide. It's a compiled html help file that comes with the 4.0 installation software. There's a flowchart for the upgrade methodology that shows that the data upgrade should be run from within the AX 4.0 client. I haven't upgraded to 4.0 yet, but I'd highly recommend following the instructions. Axapta will "clean up" anything it doesn't recognize in the database whenever a sync is performed.

  • The RecId values are determined inside the Ax-logic. You can find info here about how to issue recId's within T-SQL:

    http://www.eggheadcafe.com/software/aspnet/32805694/fix-script-for-recid-sqeu.aspx

    (script is for correcting existing numbers, so you have to change it a little. Will use this myself later and will post my solution example)

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply