January 26, 2006 at 5:06 am
Hi,
I had this problem on DTS and now I'm having the same with SSIS.
I need to add a parameter into my subquery and in some cases this is extremely important and there is no way to create the query without the subquery.
Does anyone has any idea?
Below, follow a query example about what I'm talking:
select *
from tableA a
where exists (Select ID
from tableB b
where b.ID = A.ID
and b.Date = ? )
Tks
January 26, 2006 at 6:25 am
In order to create the input parameter for an Execute SQL Task in DTS, you will need to update the Task with a Disconnected Edit:
There is a known issue with the parser for an Execute SQL Task when attempting to add an input parameter to a subquery. Let me know if this does not work or does not answer your question.
As for SSIS... I can't help you there. I only know SQL 2000 at this time.
January 26, 2006 at 7:17 am
Ok... tks Don....
Now, I'm moving this question to SQL 2005 Integration Services to get SSIS answers.
January 27, 2006 at 7:12 am
Also On DTS (sorry, not up to SS2005 yet), this might work:
DECLARE @DateParm DATETIME
SELECT @DateParm = ?
select *
from tableA a
where exists (Select ID
from tableB b
where b.ID = A.ID
and b.Date = @DateParm )
Although I have a feeling I`ve had problems assigning parameters to variables in DTS`s too
(Marvin)
January 30, 2006 at 2:54 pm
run as stored proc.
January 31, 2006 at 3:44 am
That's cool. I dont know what I was doing wrong but now the variable worked fine.
Also, a temp stored proc is a good idea as I cannot create a regular proc on the Database.
Tks fellows
January 31, 2006 at 4:45 am
Did you have a comment in the SQL? I have noticed that parameters don`t work where there are comments in the SQL
(Marvin)
January 31, 2006 at 4:57 am
it doesnt work for me either!!!!
February 2, 2006 at 10:09 am
Don't forget the semicolons:
DECLARE @DateParm DATETIME;
SELECT @DateParm = ?;
select *
from tableA a
where exists (Select ID
from tableB b
where b.ID = A.ID
and b.Date = @DateParm )
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply