Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Trigger or Store Procedure?


Trigger or Store Procedure?

Author
Message
david.ostrander
david.ostrander
SSC Journeyman
SSC Journeyman (98 reputation)SSC Journeyman (98 reputation)SSC Journeyman (98 reputation)SSC Journeyman (98 reputation)SSC Journeyman (98 reputation)SSC Journeyman (98 reputation)SSC Journeyman (98 reputation)SSC Journeyman (98 reputation)

Group: General Forum Members
Points: 98 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?

Regards,
David
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search