Using DTS getting errors inserting nulls to identity column.

  • Hi,

    I have recently added identity columns to my tables. I use DTS to extract data from Oracle and append to the tables in MSSQL. I am getting errors which indicate I am trying to insert null values into the identity columns. However I am not attempting to insert anything to the ID column. My weak understanding of ID columns is that they will automatically increment whenever a row is inserted to the table. Is that wrong?

    Why would I get these errors when using DTS. Except for the ID column I am selecting all data from the oracle side, which does not include an ID column. Shouldn't the Id column just auto increment?

    Thanks,

    Steve

  • Either:

    Make sure that you 'set identity_insert off' before the append

    Or:

    If you are writing insert into xxx (id,col1, col2).... do NOT include the id column in the list of fields or it will expect them.


    ------------------------------
    The Users are always right - when I'm not wrong!

  • As mentioned above, probably you are specifying NULL for the identity. Don't do that, just ignore it like it didn't exist.

  • I has the 'set identity_insert' set to 'on'. I have turned it off on the offending transformations and I'm testing again. It seems to be working so far.

    Thanks!!

Viewing 4 posts - 1 through 3 (of 3 total)

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