Trying to build a query on Execute SQL Task Editor.
SELECT ? = CONVERT(VARCHAR(10), COUNT(DISTINCT Email))
FROM [xxx].[dbo].[DataTEST] AS D_Test INNER JOIN
[xxx].[dbo].[ListsTEST] AS L_Test ON D_Test.ListId = L_Test.Id
WHERE L_Test.[DataSent] = 0 AND Email IS NOT NULL
When building the Query I get the error:
Error in SELECT clause: 'expression near '='.
Missing FROM clause.
Unable to parse query text.
Do I need to use '?=' for this query? Im only using that as I am emulating the .dtsx file that I am trying to diagnose/ reverse engineer.
Ive ran the query without the ?= on SQL Management Studio and it gives me the data that I want but Im unsure if me running it without that wont generate the same results.