SQL 2008 vs AutoIncrement

maxdebemaxdebe Member Posts: 3
Hi

I' ve a SQL Table which contain a field IDREC as primary Key with property Identity = yes

When I try to open the table in Nav 4sp2 I receive the following error :
"The Table xxxx contain a field which Autoincrement value daesn't match IDENTITY status of SQL Server : field IDREC"

Navision AutoIncrement property is set to NO

Can someone help me to set a NAv field using SQL Identity property ?

Thanks
Max

Comments

  • kinekine Member Posts: 12,562
    Just set the Autoincrement property of the field in NAV.

    And one thing- never set different properties directly on SQL when you are not sure what you are doing. It could lead only into problems...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • maxdebemaxdebe Member Posts: 3
    My table is an interface table between two systems.

    I would like to populate the table data from a sql souce external from NAV.

    Writing the rec i need to create the index field IDREC

    It seem to be a simple thing.....

    Max
  • kinekine Member Posts: 12,562
    And what is the problem? Have you read my answer? Is there some error when you are setting the property?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • rcverbeekrcverbeek Member Posts: 32
    edited 2022-08-17
    I ran into the same problem:the source table contains an SQL IDENTITY field, while the corresponding Nav field had AutoIncrement initially set to false.

    When I wanted to add a new field to the Nav table I ended up in a Catch 22 situation. I got the error
    "The xxx table contains a field with an AutoIncrement value that does not match the SQL Server IDENTITY status:"

    But when I changed the autoincrement of the corresponding field to true, I got the error
    "The xxx table references a SQL Server object. You cannot redesign linked objects."

    So there was no way of changing the Nav table anymore. I ended up exporting the table definition to text, adding the autoincrement property to it, deleting the object and recreating it by importing the txt file.
Sign In or Register to comment.