Which is better in id automation, is it you access the last entry on self table or in a separate table?

The situation goes like this, I have this different branches with different reservations the id must have prefix with a number and it should be sequential. I was thinking if i will access the last entry on that table or is it better to save the last entry to another table and then access it whenever they need a new ID? Any advise

Thank You!

Hi

Not quite sure what you are referring to here. If you are referring to a database and wish to have an ID value that is sequential then you can use an AutoNumber (Access), an Int with Identity Seed (SQL Server) or AUTO_INCREMENT (mySql) that will increment for you.

When you state that the ID must have a prefix for different branches, can each branch not have their own unique ID and then you use the two IDs to give you the values you need?

If this is not what you are referring to, can you provide more information.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.