c# - How can I clear down a table if the user exits? -
so have users upload files processing server. contents read sql table, call importeddata intents , purposes. user manipulates them, when want submit data processing, data submitted upstream system (not important here) , data removed said table.
however, there may situations user import , whatever reason decide navigate away page, close browser , go home day, have you. impact rows left in importeddata.
now initial thought run agent job remove rows older day; it's unlikely user want able process data morning after.
however, there "better" way?
the app constructed using mvc asp.net razor front end, c# in end, entity framework, etc. wondered there fancy remove data importeddata specific import (unique guid exact importing session) when user sort of unclean logout data unique import deleted?
i suggest not delete rows directly. scheduled job stored procedure, load old data temp table , keep until next time stored procedure executed.
logic be:
create procedure name begin ( if exists(select * sys.tables name = n'...') begin drop table ... end create table table_name ... insert table_name select .. your_table ) end
just make sure data kept incase unwilling things happen.
Comments
Post a Comment