Solved

Transact SQL Problem

Posted on 2011-03-22
7
287 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
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:ewangoya
ID: 35192640

That will not work in sql server.
Are you trying to create a temporary table with data from contacts_full
0
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

In this article I will describe the Detach & Attach 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.
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

706 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now