s

msql how to copy the result from select statement into a temp table edit button Edit

author
Murugan Andezuthu Dharmaratnam | calendar 15 October 2020 | 1984

Here is the SQL script to copy the result from the select statement into a temp table. Please note that the temporary table is automatically created for you. This is also a solution on how to create a temp table dynamically from a select statement.

Subtitle with Paragraph

select * into #SetupCountryTemp from SetupCountry
                    

I already have a table SetupCountry, In the above code, a temp table is created with all the data from SetupCountry is coped into temporary table #SetupCountryTemp