Recycling Bin - boolean field or seperate table?

  • An inventory application is being developed using ASP.NET and SQL Server and when an item is not currently being used it can be placed in a "pool", similar to a recycling bin. The items in this pool can be viewed and reused or permanently deleted. Would it be better to have a boolean field in the item table to mark an item as pooled OR would it be better to have a separate table to stored pooled items. For example, when an item is added the pool an insert would be done on the pool table.

    Would the extra field or the seperate table be a better solution?

  • pliant, Methinks the boolean the better of your two choices. However, if this is an inventory management application, there might be a better way. Not to 'soapbox', but:

    Most inventory management systems I've seen support the concept of an inventory location. Different locations within the database support different types of behavior (i.e. serialized inventory vs. non-serialized inventory, finished goods inventory, fulfillment inventory). Could you add a specialized inventory location (or locations) that support the required behavior? When an item is associated with the 'pool' location, then allow or disallow the behavior you describe.

    My thoughts,

    SJTerrill

  • Good comment.

    I prefer to delete (unless you have the location thing going on) rather have to filter the deletes out (I know, use a view, but that assumes everyone remembers to use the view). I find I do very very few undeletes, just nice to have a simple safety net to fall back on.

    Andy

    http://qa.sqlservercentral.com/columnists/awarren/

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply