Results 1 to 4 of 4

Thread: IDENTITY Column

  1. #1
    Join Date
    Apr 2003
    Posts
    11

    Unanswered: IDENTITY Column

    Hi,

    I am performing "SET IDENTITY_INSERT ON" on a table which does not have IDENTITY COLUMN. It gives me an error because of that as follows.

    Table does not have the identity property. Cannot perform SET operation.

    How do i supress the error and proceed.

    pls help.
    Thank You.

  2. #2
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    The error is self-explanatory. Check this MSDN link.
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

  3. #3
    Join Date
    Jan 2003
    Location
    India
    Posts
    523
    you will have to use alter table command to set the column identity and then u can use set command to toggle the values on or off.

  4. #4
    Join Date
    May 2003
    Location
    California
    Posts
    7

    Re: IDENTITY Column

    Originally posted by swatisk
    Hi,

    I am performing "SET IDENTITY_INSERT ON" on a table which does not have IDENTITY COLUMN. It gives me an error because of that as follows.

    Table does not have the identity property. Cannot perform SET operation.

    How do i supress the error and proceed.

    pls help.
    Thank You.
    The error states that SQL Server does not think there is an identity column on the table. If there truly is then the Index relating to the identity is corrupt. You may be able to fix it with DBCC commands but your best bet is to change the identitiy field to a int, saving it and then changing it back to an identity. Its sort of like jury rigging a table. Microsoft will recommend dropping the table and recreating it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •