Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 OLEDB Command task

Author  Topic 

sqlval
Starting Member

12 Posts

Posted - 2011-07-26 : 18:28:59
Simple question: how does a command task work if the query is passed into it with multiple parameters and multiple records? Will it work as a loop?

I have the following call in the task:
update table1
set record1 = dbo.myFunction(?)
WHERE record2 = ? AND
date1 >= DATEADD(day, DATEDIFF(day, 0, GETDATE()), 0)
AND date1 < DATEADD(day, DATEDIFF(day, 0, GETDATE()), 1);

myFunction is a function that pulls a value for parameter1. This function works if I manually pass parameters into it one by one, but it does not work properly in the command task. It looks like it updates all records with the last available value.
   

- Advertisement -