Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# SQL
I want to design database for inventory management system which is small application .
In this situation i am confused with item master structure where need to create identity column or item number column which id will manually generated by using max(prev item number).
which approach is better.
From following design there is need to maintain itemno column or ID column is ok.
and also i want to know which approach is better and when to used.
 
ID ItemNo ItemName
28 000001 Visiting Card
29 000002 wedding card
30 000003 Company Letter
31 000004 Kids book
Posted 25-Jan-13 22:42pm
vishal_h1.6K
Edited 25-Jan-13 22:52pm
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Best Practice
Always design database tables with an Identity column that is hidden from the user and a visible identifier (Item Number, Item Code, etc.) that the user can see. Doing it this way lets you code your program so that the user can change the visible identifier without affecting the other tables that are linked to this table.
 
Also, users may tell you during design that they will never need to change the visible identifier. They will eventually have a situation where they have to change it. Whether it is a merger with another company or someone mistyped the identifier, there will be a need to change it. Designing the database tables following the above Best Practice makes life easier for you and your users.
  Permalink  
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Nirav Prabtani 268
1 OriginalGriff 217
2 Mika Wendelius 185
3 CPallini 170
4 _Amy 170
0 Nirav Prabtani 284
1 OriginalGriff 217
2 Mika Wendelius 185
3 _Amy 170
4 Sergey Alexandrovich Kryukov 154


Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 26 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100