Solved

Transact SQL Problem

Posted on 2011-03-22
7
296 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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in 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

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

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

Suggested Solutions

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

737 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