Lost table Identity

  • One of my tables no longer auto-increments records that are added. When adding records I am having to include the value for the Key.

    I thought this would work, but neither value helped.

    SET IDENTITY_INSERT tablename ON

    SET IDENTITY_INSERT tablename OFF

    How do I get it back?

  • no those won't work. they are used to allow you to insert the identity values in your SQL INSERT statements.

    You need to alter the table and redefine the field as an identity field. I strongly suggest you backup the database before you do that!

    --------------------------------------------------------------------------
    When you realize you've dug yourself into a hole....Step 1...stop digging.

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

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