I need to insert the result set from dynamic query
EXEC sp_executesql @Query
into a temp table. this temp table should be created on the fly, instead of already creating it, because the columns from the dynamic query are not constant. please guide me
Edit: why i need to insert into temp table
i am trying to show usage information (products ordered) of an account. He may not order all the products, so the columns(products) are not always constant. i want to put those columns into temp table along with some other columns like date on which he has ordered and perform some operations on temp table like where conditions or groupby