Solved

Table Copy-- Invalid Object Name

Posted on 2006-06-12
5
336 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
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 500 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Server - Copy database from one server to another 3 30
how to just get time from a date 6 32
Download ms sql express. 2 25
SQL Server / Update DB? 22 36
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

809 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