Inserting data into a table from a stored procedure MS SQL 2008
Posted on 2012-09-08
I am using MS SQL 2008.
I have a stored procedure that is called by other stored proedures.
This store procedure generates a temporary table and fills it with data. It does some manipulations on the data and then returns back to the calling stored procedure.
However now i want to create a "real" table in the database and use the stored procedure to fill it.
I seemed to have trouble doing insert ** into MyTable from ... because it claims the table exists - which it does! I have created an empty table. Does the insert into statement also create the table? I wanted to do it myself so i have some control over the column definitions.
What is the best way to do this?