Friday 22 October 2010

SQL Server - Create a table from Select

I was quite surprised that SQL Server was able to do this

select *
into test_table
from handheld


This creates a table based on the results from the select. This means that you can do this

select *
into #test_table
from handheld

select * from #test_table

#test_table is only active during this session.

No comments:

Post a Comment