Is it possible to disable the IDENTITY constraint?

  • Hi

    In a table ID as created as IDENTITY.

    During table creation, it accepts constraint (ID INT CONSTRAINT IDENT IDENTITY) but latter, it is not possible to disable that constraint.

    Is it possible?

    Regards

  • Yes... here's the syntax from Books Online (comes free with SQL Server)...

    SET IDENTITY_INSERT [ database. [ owner. ] ] { table } { ON | OFF }

    ... but, generally, there's something really wrong with your design if you have to do something like that.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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