Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Table Copy-- Invalid Object Name

Posted on 2006-06-12
5
Medium Priority
?
366 Views
Last Modified: 2009-07-29
I have made back up tables before using:

Select * into Table2 from Table

But now I get an error message

Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'table2'.

Any ideas what the problem is?
0
Comment
Question by:rghunt
[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
5 Comments
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 16890336
"table" is reserved word, so "from table" wouldn't work. But the error message would be "invalid syntax". Is the statement exactly as you posted? what version of sql server?
0
 
LVL 17

Accepted Solution

by:
HuyBD earned 2000 total points
ID: 16890815
You change to

Select * into Table2 from [Table]
0
 
LVL 21

Expert Comment

by:Yurich
ID: 16890832
I think we'll need more details on what you're trying to do, but as a sarter, try to use database name as probably it's not dbo, in which case it will not be picked by default:

Select * somedbo.Table2

next one, try to check your sysobject table:

select * from sysobject where name = 'table2'

or, if you're unsure about the syntax, try this:

select * from sysobject where name liek '%table%'

it will return all objects in your databse that have table in their names

Try this, and then we'll see what can be done.
Regards,
Yurich
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 16890969
Hi rghunt,

I think you should use the ownername.tablename here..

Aneesh R!
0
 
LVL 8

Expert Comment

by:Julianva
ID: 16892247
run sp_tables to see if that table exists.

or like Aneesh said you need to used the fully qualified table name.



0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

688 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