sql server - How to make tasks double-checked (the way how to store it in the DB)? -


I have a DB that stores different types of functions and more items in different tables. In many of these tables (which differ from their structure) I have one way to do this, that the item has to be checked twice, which means that the item can not be "saved" (I mean it definitely

  1. Each table should have a column called "IsConfirmed", then when that person wants to confirm all things, the program runs through all the tables and a list of those items Makes ones che Not used.
  2. The table should be the third table holding the name and the ID of the line which should be confirmed.
  3. I hope that you have a better idea than two subdivisions.

Is this really a double-confirmed status for a single entity? Or can it be rejected and need to go through the confirmation again? In the latter case, should you keep all this history? Do you need to keep track of every time you confirm (for example, you do not have both people confirming)?

Simple case:

  Add optional table Dbo.Table Confirm Add TINYINT No less than 0; Add optional table dbo.Table processed bit zero zero 0;  

First confirmation:

  UPDATE dbo.Table SET confirmation = 1 where PK = & lt; PK & gt; And confirmation = 0;  

On second confirmation:

update dbo.Table Confirm SET = 2 where PK = & lt; PK & gt; And confirmation = 1;

If rejected:

UPDATE dbo.Table SET ConfirmCount = 0 WHERE PK = & lt; PK & gt;

Now your background job can only treat those rows where processed = 0 and confirm = 2. Then when the line is processed Has been done:

  update dbo.Table processed SET = 1 where PK = & lt; PK & gt;  

If you have a more complex scenario than this, please provide more details, including the goals of the double-confirmation process.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -