Solved

Table Copy-- Invalid Object Name

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Can we attach PDF to table 2 46
database audit for object access 6 42
sql server string_split 4 30
Creating Scalar Function 3 20
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

710 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