I am doing it row by row because i think its the only way to do this .
The query i have mentioned, if run directly in TSQL ..it returns 3 rows for a specific table of my database.
But when i wrote stored procedure using the same query it inserted the first row in my table. (The first of the 3 rows which where returned by the query,when executed alone)