• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 305
  • Last Modified:

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.

0
jonsuns7
Asked:
jonsuns7
2 Solutions
 
jonsuns7Author Commented:
thank you
0
 
jimtpowersCommented:
SELECT *
INTO   Contact_info
FROM  Contacts_full

Open in new window

0
 
Ephraim WangoyaCommented:

That will not work in sql server.
Are you trying to create a temporary table with data from contacts_full
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
philetaylorCommented:
T-SQL has it's oddities like this....

Try:

SELECT * INTO Contact_Info FROM Contacts_Full

Cheers

Phil
0
 
kumarnimavatCommented:
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now