Thanks for the reply nigelrivett, however I can't use this solution as it works only with stored procedures, and I can't user sprocs.
What I'm trying to do is this:
I have a server where my packages are.
From this server I need to transfer data to 5 different servers and only data that doesn't exist on target server, so I need to verify data existence against target server.
In my main package I get recordset of server names and loop in Activex Script. In loop, I set global variables for child package and execute it.
In child Activex script I change one of my connections to global var (server name) from parent package. Now I need to pass global var to SQL Task as a parameter.
So I run SQL like this:
INSERT INTO myTable
(col1,
col2)
SELECT col1, col2
FROM mainServer.myDB.dbo.myTable
WHERE col1 NOT IN
(SELECT col1 FROM myTable
WHERE serverName = myGlobalVarfromParentPackage)
Because I change connection, this SQL will be valid for all 5 target servers and it will run as it's running on target server, even it's being executed from source server.
If I use sproc, I need to create separate SQL for each server to verify that only new items are being transferred. If everything would be on the same server, I'd use sproc and forget about this hassle, but ...
All I need to figure out how to pass global var to SQL task. I can do it in Activex Script but then I need to do like 20 calls as I have about 20 SQL tasks in child package.
I hope I explained clearly why I need to do it this way. Can't think of any other ways of doing it.
Thanks
Steve