Menu

#32 Insert arbitrary values into AutoNumber column

2.1.1
closed
None
1
2015-05-01
2015-04-04
No

Access allows us to INSERT arbitrary values into an AutoNumber column, similar to what T-SQL can do with SET IDENTITY_INSERT ... ON. It would be nice if Jackcess had a similar option.

Discussion

  • James Ahlborn

    James Ahlborn - 2015-04-05

    Would you be okay with a database/table flag which allows "unsafe" inserts (similar to disabling foreign key checking)? where the default behavior stays the same?

     
    • Gord Thompson

      Gord Thompson - 2015-04-05

      Yes, that sounds like a good approach.

       
      • James Ahlborn

        James Ahlborn - 2015-04-08

        would you need to set this on a per-table basis, or only at the database level?

         
        • Gord Thompson

          Gord Thompson - 2015-04-08

          Hmm, good question. T-SQL only allows IDENTITY_INSERT to be enabled for one table at a time, but I've not seen an explanation of why that restriction is in place (though I've never really looked for one). Per-table would probably be safer and more flexible (e.g. for "unsafe" inserts into one table and "safe" inserts into others), provided that it's not a huge PITA to implement.

           

          Last edit: Gord Thompson 2015-04-08
  • James Ahlborn

    James Ahlborn - 2015-05-01

    The ability to directly insert/update autonumbers can now be selectively enabled per-jvm (using a system property), per-database, and per-table.

    fixed in trunk, will be in the 2.1.1 release.

     
  • James Ahlborn

    James Ahlborn - 2015-05-01
    • status: open --> closed
    • assigned_to: James Ahlborn
    • Group: Unnassigned --> 2.1.1
     

Log in to post a comment.

MongoDB Logo MongoDB