passing cursor variable into a query
===

I am an Oracle developer trying to learn T-SQL.
I have a table with one column in it (table_name). I need to be able to loop over all rows and find all columns for a given table. Then I need to output the result of it to the file.
In Oracle it is pretty simple by using cursor in this fashion:

cursor my_curr is select table_name from my_table;
for x in my_curr loop
   select column_name from user_tab_columns
   where table_name = x.table_name;

   utl_file ..... (writing result to an OS file)
end loop;

What is the equivalent of the above in T-SQL? How would I use cursor variable to pass it into the query?

Thanks,
Eugene