Query does not return any results

Edgar Toia Neto 1 Reputation point
2020-08-27T16:18:44.39+00:00

Hello,

I am running the following query on SSIS on the AdventureWorks2012 database..

select
c.CustomerID as CustomerAK,
p.Title,
p.FirstName,
p.MiddleName,
p.LastName,
p.Suffix,
em.EmailAddress
from Sales.Customer c
join Person.Person p
on c.PersonID = p.BusinessEntityID
left join Person.EmailAddress em
on p.BusinessEntityID = em.BusinessEntityID
where
(em.ModifiedDate > ?
OR p.ModifiedDate > ?)
AND (
em.ModifiedDate <= ?
OR p.ModifiedDate <= ?
)

Does anyone know why no results are returning?

Another thing, does anyone know what it means "Question Mark >?" ?

Thank you.

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,467 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Yitzhak Khabinsky 25,201 Reputation points
    2020-08-27T21:38:14.46+00:00

    You need to do the following:

    1. Create four SSIS variables
    2. Assign their values
    3. Map those variables in the SSIS Task (Execute SQL or OLEDB Source Adapter, etc.)
    0 comments No comments

  2. Monalv-MSFT 5,896 Reputation points
    2020-08-28T02:50:19.957+00:00

    Hi Edgar Toia Neto,

    May I know where do you run the sql query?

    1.If in Execute SQL Task, please refer to the following link and pictures:
    Parameter names and markers in Execute SQL Task.
    21102-variable.png
    21111-generalpageinesteditor.png
    20980-parametermappingpageinesteditor.png

    2.If in OLEDB source, please refer to the following link and pictures:
    To map a query parameter to a variable.
    21086-oledbsourcestatementwithparameter.png
    21112-previewqueryresults.png

    Best Regards,
    Mona


    If the response is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments