Using parameters works fine in this case .
i have written a stored proc which stores the results of this query in parameters, and then inserts these values in a table . But it does that only for the first row returned by the query.
I want to repeat this process for all the rows . As i want to store all rows returned by this query in a specific table.