Database status table Design

Source: Internet
Author: User

During the internal business training yesterday, we talked about the history of supplier status changes in the procurement business. As the company's business changes, the supplier status in the system's status table is constantly increasing.

However, since we have considered the future scalability at the beginning of the design, our status is not continuous. For example, the new status is 1, the review status is 11, and the void status is-1.

And so on.

Although this design ensures a certain degree of scalability, we may not need to select these unnecessary states in some places in the system. For example, I can view reports.

Because this status is no longer used, I do not need to be used as a filter condition. However, if no visible field is added for control, we must implement programming control at the system front-end.

.

This is obviously inconvenient, and the workload for subsequent development and maintenance is also increased. Therefore, this situation should be considered during database design.

The 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.