• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 260
  • Last Modified:

I need assistance with some SQL Server syntax

How do you make an
INSERT query to copy a table in a non existant table?

I tried this but it's not working:

INSERT INTO TABLECopy SELECT * FROM TABLE1

I get an Invalid object name 'TABLECopy'.


Thanks
mrotor
0
mainrotor
Asked:
mainrotor
1 Solution
 
radcaesarCommented:
SELECT *
INTO new_table_name [IN externaldatabase]
FROM old_tablename
0
 
Ephraim WangoyaCommented:
do you mean a temporary table

INSERT INTO #TABLECopy
SELECT * FROM TABLE1
0
 
TonyRebaCommented:
insert into tablecopy select * from table

that should work
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.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now