Solved

Transact SQL Problem

Posted on 2011-03-22
7
298 Views
Last Modified: 2012-05-11
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.

0
Comment
Question by:jonsuns7
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 

Author Comment

by:jonsuns7
ID: 35192598
thank you
0
 
LVL 4

Expert Comment

by:jimtpowers
ID: 35192639
SELECT *
INTO   Contact_info
FROM  Contacts_full

Open in new window

0
 
LVL 32

Expert Comment

by:Ephraim Wangoya
ID: 35192640

That will not work in sql server.
Are you trying to create a temporary table with data from contacts_full
0
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
LVL 4

Accepted Solution

by:
philetaylor earned 250 total points
ID: 35192646
T-SQL has it's oddities like this....

Try:

SELECT * INTO Contact_Info FROM Contacts_Full

Cheers

Phil
0
 
LVL 3

Assisted Solution

by:kumarnimavat
kumarnimavat earned 250 total points
ID: 35197851
If the table already exists then you may use below given query :-

insert into Contact_Info
SELECT * FROM Contacts_Full
0
 

Author Closing Comment

by:jonsuns7
ID: 35212501
Thank you this was quite helpful.
0
 
LVL 4

Expert Comment

by:jimtpowers
ID: 35215067
@jonsuns7 - Any reason why you did not select my response as your answer since it was identical to @philetaylor and posted first?
0

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

687 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