You can configure your SQL Task to return a Full Result Set on the General tab, then assign the result to an object variable on the Result Set tab.
To loop through the object variable, use a Foreach Loop. On the Collection tab, set the enumerator to Foreach ADO Enumerator, and set ADO object source variable to the object that was populated by the SQL Task.
On the Variable Mappings tab, assign one package variable to contain each column in the object variable. Set Index to zero to assign the first column returned to a variable, set it to 1 to assign the next, and so on.
Then access those variable(s) in a File System task from within the Foreach loop.