We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

I need assistance with some SQL Server syntax

Medium Priority
268 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
Comment
Watch Question

Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Ephraim WangoyaSoftware Engineer
CERTIFIED EXPERT

Commented:
do you mean a temporary table

INSERT INTO #TABLECopy
SELECT * FROM TABLE1

Commented:
insert into tablecopy select * from table

that should work
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.