Transact SQL Problem

Hi Everyone,

I have a SQL Statement here for which I keep getting the following error message:

      SQL Server Database Error: Incorrect syntax near 'Contacts_full'.      

This is the SQL Statement:

Create Table Contact_info  AS (Select  *  from Contacts_full);

I have issued similar statements in Oracle but for some reason it gives me an Error in SQL Server 2005.

jonsuns7Asked:
Who is Participating?
 
philetaylorConnect With a Mentor Commented:
T-SQL has it's oddities like this....

Try:

SELECT * INTO Contact_Info FROM Contacts_Full

Cheers

Phil
0
 
jonsuns7Author Commented:
thank you
0
 
jimtpowersCommented:
SELECT *
INTO   Contact_info
FROM  Contacts_full

Open in new window

0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Ephraim WangoyaCommented:

That will not work in sql server.
Are you trying to create a temporary table with data from contacts_full
0
 
kumarnimavatConnect With a Mentor Commented:
If the table already exists then you may use below given query :-

insert into Contact_Info
SELECT * FROM Contacts_Full
0
 
jonsuns7Author Commented:
Thank you this was quite helpful.
0
 
jimtpowersCommented:
@jonsuns7 - Any reason why you did not select my response as your answer since it was identical to @philetaylor and posted first?
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.