Trigger or Store Procedure?

  • Hello -

    Little quick background. My endusers access a table via excel to run reports. I'll call them Table-A and Table-B alternate the data that is inserted with data from Production every 2 hours.

    I use Synonyms so they can use and access Table-A that has the last data pulled while the newer data in Table-B is updated and then it switches over behind the scenes so the all the enduser has to do is refresh in excel and they have the current data just pulled.

    Hope that makes sense without writing a novel.

    In this SSIS package that the 1st Step that runs is

    DELETE FROM dbo.BackLogLaborOld

    WHERE (datename(dw,PIT)<>'Friday' or datepart(hh,PIT) <> 16)

    I want to keep all Friday at 4:00PM data and not have them deleted from either Table-A or Table-B. The issue I'm having is the package seems to be alternating the weeks it keeps the Friday at 4:00. For example in February I only have the Friday at 4:00 data kept for the weeks of the 8th and 22nd. The 1st and 15th do not show any Friday at 4:00 data.

    Is there a way I can either create a Trigger or Store Procedure to check Table-A and Table-B for that Friday at 4:00 data and update either table that does not have it in it?

    Regards,

    David

Viewing 0 posts

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