Greetings,
As I am learning to use variables/parameters in SSIS, I did an experiment with a simple piece of code (in advance of placing my real query into place). I add the following to an OLE DB Source Box in the SQL Command Window, which of course works just fine:
SELECT * FROM PATIENT WHERE ADM_DATE > '12/31/2017'
NEXT: I then added my parameter/mapping to this simple query and this too works just fine:
SELECT * FROM PATIENT WHERE ADM_DATE > ?
NEXT: I then added a CTE to this code just to confirm that it will work with a CTE (the code below did not work).
WITH CTE AS
(
SELECT * FROM PATIENT WHERE ADM_DATE > ?
)
SELECT * FROM CTE
Direction Needed:
Is it possible to use CTEs with parameters in an OLE DB Source object? (eventually I will add 3 parameters: FromDate, ToDate, Hospital ID). What is the best way to handle this given that my real code is built with CTEs? I sincerely appreciate your advice./direction on this.
Many Thanks!
Dave