Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

I need assistance with some SQL Server syntax

Posted on 2011-04-28
3
Medium Priority
?
257 Views
Last Modified: 2012-05-11
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
Comment
Question by:mainrotor
3 Comments
 
LVL 9

Accepted Solution

by:
radcaesar earned 2000 total points
ID: 35486933
SELECT *
INTO new_table_name [IN externaldatabase]
FROM old_tablename
0
 
LVL 32

Expert Comment

by:Ephraim Wangoya
ID: 35486939
do you mean a temporary table

INSERT INTO #TABLECopy
SELECT * FROM TABLE1
0
 
LVL 9

Expert Comment

by:TonyReba
ID: 35486975
insert into tablecopy select * from table

that should work
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Recursive SQL is one of the most fascinating and powerful and yet dangerous feature offered in many modern databases today using a Common Table Expression (CTE) first introduced in the ANSI SQL 99 standard. The first implementations of CTE began ap…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question