• For using variables in SQL Task you need to use the Parameter mapping and map the variables. Depending on your connection type the parameter marker and parameter name would differ. Please go through http://technet.microsoft.com/en-us/library/ms141003.aspx for details.

    And for using the resultset returned from your query, you need to use Foreach loop with ADO enumerator. The following link is a very good example for the same:

    http://www.codeproject.com/KB/database/foreachadossis.aspx

    HTH

    ~Mukti