passing parameter in to OLE db source in SSIS -
10-16-2006
, 12:42 PM
Hi,
I trying to pass ineteger varialble to sql statement in ole db source
located inside data floor task
of SSIS
example
select cusomername from customers where customerNo =?
I can map parameter, to my variable but during execution, values
assigned to customerNo is
always the same
select cusomername from customers where customerNo = @P1',1
BUT
it work fine with "Execute sql task "when I try to execute same query
with parameter
I run profiler and noticed difference
-----------------
for SQL OLE db source RPC completed
--variable value = 5000
declare @p1 int
set @p1=1
exec sp_prepare @p1 output,N'@P1 bigint'
select cusomername from customers where customerNo = @P1',1
--------------
for SQL Exec task
--variable value = 5000
exec sp_executesql N' select cusomername from customers
where customerNo @P1',N'@P1 nt',5000
What is correct way to pass parameter to OLE db source query ? |