I'm using 2 databases [Elg] and [VTrader]
Within [Elg] there are 3 tables( ElgFileQueue, RXFileQueue, and CostFileQueue) and each shares 2 columns called FileName and FileCatalogedOn. The FileName data is also shared in [VTrader] under the column name OrigName. I'm trying to find every file that comes in through the 3 ELG tables under FileName and compare that vs OrigName data on VTrader. The output should display FileNames and the FileCatalogedOn date that are NOT shared on VTrader OrigName.
Notes: FileCataloguedOn is using datetime I’ve not made very much progress and have been held up on trying to join all 3 tables in Elg and pull the files names into one place and then my idea was to use an outer join to see what files VTrader is missing that Elg contained.
CODE Example
Use Elg
Select
FileName
,FileCatalogedOn
From
ElgIFileQueue
where
cast(filecatalogedon as date) = cast(getdate()-1 as date)
order by filecatalogedon desc
This will output yesterdays Filenames from Elg.ElgFileQueue
select
OrigName,
startDT
from
VTraderer
where
cast(StartDt as date) = cast(getdate()-1 as date) and
order by startdt desc
This outputs yesterdays files from VTrader and gives me the file names and startDT = file catalogue date.
The goal is to get all files from Elg Tables mentioned and the VTrader table and output any files that are missing from Vtrader that are in Elg.