create temp table with select statement

Hi Expert,

Why it does'nt work

CREATE TABLE #temCity1 AS SELECT * into #temCity FROM tblCity

Thanks in advance
LVL 1
dshi15Asked:
Who is Participating?
 
RiteshShahCommented:
emps is original table and #t is temp

select * into #t from emps
 
select * from #t

Open in new window

0
 
RiteshShahCommented:
dont use CREATE table, don't need it, just use

SELECT * into #temCity FROM tblCity
0
 
BrandonGalderisiCommented:
RiteshShah's method is correct.

Here's a post we have over at http://SQLServerNation.com explaining how to use select/into.

http://sqlservernation.com/blogs/tipweek/archive/2009/02/23/select-into.aspx
0
 
RiteshShahCommented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.