Unix Technical Forum

missing tables in sysobjects

This is a discussion on missing tables in sysobjects within the SQL Server forums, part of the Microsoft SQL Server category; --> Hi, I'm using "select [name] from sysobjects where OBJECTPROPERTY(id, N'IsUserTable') = 1" to get all user-defined tables(about 17000 tables) ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 07:25 PM
neo
 
Posts: n/a
Default missing tables in sysobjects

Hi,
I'm using "select [name] from sysobjects where OBJECTPROPERTY(id,
N'IsUserTable') = 1" to get all user-defined tables(about 17000
tables)
and found out there are tables missing in sysobjects.
How can I refresh/rebuild sysobjects table?
is there a better way to get a list of user-defined tables?

thanks,
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 07:25 PM
Mystery Man
 
Posts: n/a
Default Re: missing tables in sysobjects

second714@hotmail.com (neo) wrote in message news:<155f8e7d.0401061038.11ea8cc7@posting.google. com>...
> Hi,
> I'm using "select [name] from sysobjects where OBJECTPROPERTY(id,
> N'IsUserTable') = 1" to get all user-defined tables(about 17000
> tables)
> and found out there are tables missing in sysobjects.
> How can I refresh/rebuild sysobjects table?
> is there a better way to get a list of user-defined tables?
>
> thanks,


Perhaps what is missing are VIEWS?

Try the following

select * from INFORMATION_SCHEMA.tables

Please let me know how you get on.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 07:25 PM
Erland Sommarskog
 
Posts: n/a
Default Re: missing tables in sysobjects

neo (second714@hotmail.com) writes:
> I'm using "select [name] from sysobjects where OBJECTPROPERTY(id,
> N'IsUserTable') = 1" to get all user-defined tables(about 17000
> tables)
> and found out there are tables missing in sysobjects.
> How can I refresh/rebuild sysobjects table?
> is there a better way to get a list of user-defined tables?


So how to you know they are missing? I'd say that if a table is not in
sysobjects it does not exist...

You can use DBCC CHECKCATALOG to check the system tables for inconsistency.

Mystery Man's suggestion that you might be looking for views seems worth
investigating. I'll add table-valued functions to the list.

--
Erland Sommarskog, SQL Server MVP, sommar@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:44 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com