Table Copy-- Invalid Object Name

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?
rghuntAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
HuyBDConnect With a Mentor Commented:
You change to

Select * into Table2 from [Table]
0
 
Vadim RappCommented:
"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
 
YurichCommented:
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
 
Aneesh RetnakaranDatabase AdministratorCommented:
Hi rghunt,

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

Aneesh R!
0
 
JulianvaCommented:
run sp_tables to see if that table exists.

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



0
All Courses

From novice to tech pro — start learning today.