0 Replies Latest reply on Jun 18, 2004 4:40 PM by dan3

    How to handle identity (auto-increment) sql server columns

    dan3

      Hi.

      I am looking at using JBoss for a website redisign.

      When I tried to create some simple beans in JBuilder X for use with JBoss I found that I could retrieve data ok but when I tried to insert into a table I got the following error:

      [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Cannot insert explicit value for identity column in table
       'T_AppraisalForms' when IDENTITY_INSERT is set to OFF.


      The problem is that we have an existing database design with lots of identity type columns. We also have code that can update the database from external sources so we do not have the option to manually increment the keys and use the IDENTITY_INSERT option within the query.


      Is there a way in which we can instruct JBoss to not insert values into the identity columns of the database?

      Regards,
      Dan