Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Trigger or Store Procedure? Expand / Collapse
Posted Thursday, March 7, 2013 10:37 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Wednesday, April 20, 2016 2:41 PM
Points: 92, Visits: 692
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?

Post #1428131
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse