Solved

Transact SQL Problem

Posted on 2011-03-22
7
294 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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Ssis not sending failure message 2 26
ISDATE() not working properly on my table? Any suggestions. 7 28
SQL 2008 R2 syntax 11 29
SQL server 2008 and after encryption method 32 50
by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
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.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

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