Added code for creating a temp table from a sql reult set.