The state of the database table design

         Yesterday, when the system internal business training, talked about the history of changes of state procurement suppliers, the company's business with the state table changes, system vendors continue to increase the state.

Nonetheless, because we in the beginning of the design data after taking into account scalability, so our state is not continuous, such as the new state is 1, the approval status is 11, whether obsolete State-1

and many more.

         Although this design ensures scalability certain degree, but for those we do not need to state some places we might not have to choose in the system, for example, I view reports

When, as in this state no longer used, I do not need a filter criteria, but if you do not add a field to do the control is visible, then we must control system front-end programming

A.

        This is clearly less convenient, but also the follow-up development and maintenance workload increased, so when doing database design should also consider the situation.

Table design should include the following fields:

 [ID] [int] NOT NULL,
 [Status] [int] NOT NULL,
 [StatusDesc] [nvarchar](40) NOT NULL,
 [Remark] [nvarchar](250) NOT NULL,
 [Visiable] [bit] NOT NULL,

 [SvrID] [int] NOT NULL       

Reproduced in: https: //www.cnblogs.com/kevinGao/archive/2013/03/07/2964339.html

Guess you like

Origin blog.csdn.net/weixin_33961829/article/details/93052374