Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Table exists in sysobjects yet object doesn't exis

Author  Topic 

unclesamis@cox.net
Starting Member

18 Posts

Posted - 2010-07-26 : 12:47:13
Table exists in sysobjects yet object doesn't exist.

I query the table name in sysobjects and it exists as a table. If I query the table to see the values in it, it doesn't exist.

I recreated the table again with the same name. In sysobjects it shows two tables now with the same name. I am able to query the contents of the table. So then I dropped the table. And I can't find the table object anymore, but there shows that one that exists in the sysobjects.

Didn't think it was possible to have two names that same of the same object in sysobjects.

I need to get the illusionary table out of sysobjects.

Kristen
Test

22859 Posts

Posted - 2010-07-26 : 12:50:17
Table owned by a different schema?
Go to Top of Page

unclesamis@cox.net
Starting Member

18 Posts

Posted - 2010-07-26 : 12:57:47
Good thinking about the schema. But no it is not.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-07-26 : 13:00:57
View? and again for a specific schema

The Schema name's ID is in sysobjects too

Do you have SA permission? If not you may not be able to query the schema that the Table/View is in.

Are Synonyms in sysobjects in that way too?

Or maybe the TYPE column in sysobjects is "U" in which case it aint a view/etc. OK, what IS the value of TYPE column in sysobjects
Go to Top of Page

unclesamis@cox.net
Starting Member

18 Posts

Posted - 2010-07-26 : 13:14:06
It is a user table, type 'U'. But I just now noticed that the uid is different and is the only one of it kind in the table. I used the import wizard to create the table and don't know how it got that particular login. I can't seem to view or drop the table even logged in as SA.
Go to Top of Page

unclesamis@cox.net
Starting Member

18 Posts

Posted - 2010-07-26 : 13:43:51
Thanks Kristen for helping me identify that it was a different schema.

I went back to the import wizard and was able to identify the schema as a name that doesn't appear to exist.
I used that to drop the table.

Thanks so much Kristen, you are awesome.

Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-07-26 : 13:48:57
glad you got it sorted. for future reference:

select name [table], schema_name(schema_id) [schema_name]
from sys.tables
where name = 'table name here'
Go to Top of Page

unclesamis@cox.net
Starting Member

18 Posts

Posted - 2010-07-26 : 14:10:25
Thanks Russell
Go to Top of Page
   

- Advertisement -