5
I’m creating a product control for a company, where we need to generate sequential codes for products as they register, sell digital products, so there’s no physical amount. At first I thought about using a auto increment field, but we have another problem: We sell the products by packages, that is, it would require several simultaneous losses, because 1 in 1 would not make much sense or take longer. I also heard about the SEQUENCE function (Implemented in SQL Server 2012).
What would be the best suggestion for a database?
The interface thought of using C#, as well as using SQL Server for the database.
What you suggest to me?
A primary key is a field that uniquely identifies what the table implements, can be a sequential number, a code, etc. , how this relates to the low ?
– Motta
Gustavo, do you want to create a control to create the product code or control a unique number for each product (serial number)? I have these two controls, my solution was to create a table with the control of the sequences. Is this your doubt? If it is, I can detail my solution.
– Developer
Good morning, I solved the problem by placing a primary key with same auto increment aligned with another to have a prefix to differentiate. Thank you very much.
– Gustavo Ferreira da Silva
@Gustavoferreiradasilva If you found the solution please post it as reply. Thank you.
– Genos