Announcement

Collapse
No announcement yet.

The error "'tbl_934_F2_l_Test' does not contain an identity column."

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • The error "'tbl_934_F2_l_Test' does not contain an identity column."

    I use:
    - Win 7x64
    - ms Sql Server 2012
    - Navicat 12.0.17 (64-bit) - Premium.

    There is an existing table.
    The table is filled with data.
    I want to make the field `id` autoincrement.
    I get the error: "'tbl_934_F2_l_Test' does not contain an identity column."


    The error "'tbl_934_F2_l_Test' does not contain an identity column."

    Question: how to set the autoincrement field?

    Code:
    CREATE TABLE [dbo].[tbl_934_F2_1_Test] (
    [id] int NOT NULL,
    [Text] varchar(255) COLLATE Cyrillic_General_CI_AS NULL,
    CONSTRAINT [PK__tbl_934_2_1_Test] PRIMARY KEY CLUSTERED ([id])
    WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
    ON [PRIMARY]
    )
    ON [PRIMARY]
    GO
    
    ALTER TABLE [dbo].[tbl_934_F2_1_Test] SET (LOCK_ESCALATION = TABLE)
    Last edited by ivclim; 03-28-2019, 10:45 AM.

  • #2
    Hi ivclim,

    Please note that if you want to add an identity field to an existing table, you need to add a new field and set it in the Options tab. For SQL Server, existing fields cannot set as identity field.

    1. Open a table designer.
    2. Add an int, decimal or numeric field in the Fields tab.
    3. Select the Options tab, choose the new field in the Identity Field drop-down list.
    4. Set the Identity Seed, Identity Increment, Current Identity Value options if necessary.
    5. Save the settings.

    Comment

    Working...
    X