2 Replies Latest reply on Feb 5, 2003 4:38 AM by sebastien_petrucci

    Auto incrementing primary key in MS SQL Server 7

    earnest

      Hello all,

      I am using jboss-3.0.4_tomcat-4.1.12 and my database is MS SQL Server 7. I have a table with auto incrementing primary key. Is it possible for me to develop an entity bean in this situation? If yes, please give me some pointers to continue.

      Any help is deeply appreciated.

      Thanks & Regards
      Earnest A Thomas

        • 1. Re: Auto incrementing primary key in MS SQL Server 7
          earnest

          urgent help needed on this post...please help

          • 2. Re: Auto incrementing primary key in MS SQL Server 7
            sebastien_petrucci

            Either switch to JBOSS 3.2RC1 or change your CMP into BMP...

            - By using BMP, you can retrieve yourself your generated pk, in your DB specific manner. (something like "select @@last-id()" - check SQL Server doc)

            - With JBOSS 3.2 RC1, you can use generated pk but only with unknown-pk (which may cause a problem in some circomstances). Basically for MS SQL Server, it should work if you have a JDBC 3.0 driver, or maybe by using the 'pk-sql' entity command (checks posts about unknown-pk for JBOSS3.2) and correct SQL (something like "select @@last-id()" - check SQL Server doc)