Hi, I am trying to change a DTS package so that it uses global variables rather than 'hardcoded' dates but the step that deletes the data from the tables does not work.
The way the pkg works is that it deletes the last 15 days worth of data & then goes and re-retrieves it again. I want to be able to run it for a specific period if necessary.
The Global Variables (StartDate & EndDate) are set up & it works fine for the steps that retrieve data (DATA PUMPS) but NOT for the step that deletes data (Execute SQL Task). It gives the Error message "The column prefix 'sessions' does not match with a table name or alias used in the query"
Do I need to modify my SQL some more?
THIS IS THE CURRENT SET UP AND IT WORKS FINE
delete summline
from sessions, summline
where sessions.sessdate >dateadd (d,-15,getdate()) and
sessions.sessionid = summline.sessionid and
sessions.siteid = summline.siteid
THIS IS WHAT I HAVE CHANGED IT TO (DOES NOT WORK)
delete summline
from sessions, summline
where sessions.sessdate BETWEEN ? AND ? and
sessions.sessionid = summline.sessionid and
sessions.siteid = summline.siteid
AND AS AN FYI THIS DOES WORK OK IN THE DATAPUMP TASKS!!!!?
select summline.*
from sessions, summline
where sessions.sessdate BETWEEN ? AND ? and
sessions.sessionid = summline.sessionid and
sessions.siteid = summline.siteid
The way the pkg works is that it deletes the last 15 days worth of data & then goes and re-retrieves it again. I want to be able to run it for a specific period if necessary.
The Global Variables (StartDate & EndDate) are set up & it works fine for the steps that retrieve data (DATA PUMPS) but NOT for the step that deletes data (Execute SQL Task). It gives the Error message "The column prefix 'sessions' does not match with a table name or alias used in the query"
Do I need to modify my SQL some more?
THIS IS THE CURRENT SET UP AND IT WORKS FINE
delete summline
from sessions, summline
where sessions.sessdate >dateadd (d,-15,getdate()) and
sessions.sessionid = summline.sessionid and
sessions.siteid = summline.siteid
THIS IS WHAT I HAVE CHANGED IT TO (DOES NOT WORK)
delete summline
from sessions, summline
where sessions.sessdate BETWEEN ? AND ? and
sessions.sessionid = summline.sessionid and
sessions.siteid = summline.siteid
AND AS AN FYI THIS DOES WORK OK IN THE DATAPUMP TASKS!!!!?
select summline.*
from sessions, summline
where sessions.sessdate BETWEEN ? AND ? and
sessions.sessionid = summline.sessionid and
sessions.siteid = summline.siteid