I want to insert the stored procedure result set into a table. Is it possible to create a table dynamically? Columns may vary so please help.
This is my stored procedure result set where columns BYL, NYX, PAR
may vary to more than 10 columns.
I need to dynamically create a table and insert this data into that table.
I tried queries like
CREATE TABLE new_tbl BY
SELECT *
FROM tmrCount1;
But this are possible in MySQL not in SQL Server
Tol1 toolname ABC DEF GHJ HFJ KJD
--------------------------------------------
1 test1 18 0 24 0 1
2 test2 0 1 0 0 0
4 test3 0 1 0 1 0
5 test4 14 0 60 1 2