How to create a temporary table for Stored Procedure?
How to create Temp Table for Stored Procedure in SQL Server?
44521-Oct-2021
Updated on 21-Oct-2021
Home / DeveloperSection / Forums / How to create Temp Table for Stored Procedure in SQL Server?
How to create a temporary table for Stored Procedure?
Steilla Mitchel
08-Nov-2021SQL Create Temp table for stored Procedure:
Sometimes we forget about result set of created Stored Procedure and we have need to create a temporary table based on that stored procedure then try the following SQL statement to create a temp table base in the stores procedure by using the following SQL statement-
Syntax-
Then
Ex-
First I have create a Stored procedure
Here the following SQL statement is used to create a temp table to store the result set of the stored procedure,
Execute the temp table
If you are getting error to perform the above SQL statement then you need to enable the ad hoc distributed queries by using the following queries,
If you want to show all advance system setting then use the following SQL statement,
To set the default system setting use the following statement,