By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,574 Members | 1,977 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,574 IT Pros & Developers. It's quick & easy.

SQL Server 2005 Metadata

N002213F
P: 39
Does SQL Server 2005 have system tables that you can select to see meta data about a table? I have seem such tables in Oracle.

I would like to retrieve certain tables properties for analysis and comparisons

Any pointers most appreciated
Oct 27 '08 #1
Share this Question
Share on Google+
5 Replies


debasisdas
Expert 5K+
P: 8,127
yes those are also available here.
Oct 27 '08 #2

N002213F
P: 39
Some names or web page might help.

Thanks in advance
Oct 27 '08 #3

ck9663
Expert 2.5K+
P: 2,878
Depending on the version of SQL Server you're working on, there's a table called sysobjects.

If you're working with SQL 2005, there's a view called sys.tables

So, try the following:

Expand|Select|Wrap|Line Numbers
  1. select * from sys.tables
  2.  
  3. select * from sysobjects

-- CK
Oct 27 '08 #4

N002213F
P: 39
Found it;
Expand|Select|Wrap|Line Numbers
  1. SELECT NAME FROM SYS.TABLES ORDER BY NAME
and
Expand|Select|Wrap|Line Numbers
  1. EXEC SP_SPACEUSED[TABLENAME]
I used Java to do the the looping, will look at using SQL procedures.
Oct 28 '08 #5

N002213F
P: 39
Depending on the version of SQL Server you're working on, there's a table called sysobjects.

If you're working with SQL 2005, there's a view called sys.tables

So, try the following:

Expand|Select|Wrap|Line Numbers
  1. select * from sys.tables
  2.  
  3. select * from sysobjects

-- CK
Thanks, if selecting from the sysobjects, one may have to specify the type, lest you get all the objects.
Oct 28 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.