Sql select results into temporary table
How do I do a SELECT INTO [temp table FROM [stored procedure? Not FROM [Table and without defining [temp table? Select all data from BusinessLine into tmpBusLine works fine. select into tmpBusLine from BusinessLine How to do sum of col results from a SQL Stored Procedure. 2.Dynamic SQL results into temp table in SQL Stored procedure. And when I put it, it complains that there is no table to select from. . SELECT INTO# tmpinput EXECUTE('SELECT 1 AS test'); SQL Server Database Error: Must specify table to select from. Select columns from result sql select results into temporary table
Since you've already accepted an answer, I wanted to offer just a note: Select Into isn't for temporary tables , it is for creating a new table based on the structure (and data) of the select portion of the query. For a table X, you can only ever Select Into it a maximum of 1 time, after that you need to use Insert Into to append any data.
Learn how to insert the results of a stored procedure into a temporary table in SQL Server. In this data tutorial, we will outline options to INSERT results I have a SQL query (SQL Server) and it generate reports, I want to store that exact report in temp table so I can play with it later. Now question is do I need to create temp table first and then store SQL query result into it, or is there any way to dynamically create table and store query result?sql select results into temporary table I need to save select query output into temporary table. Then I need to make another select query against this temporary table. Does anybody know how to do it? I need to make this on SQL Server.