php newbie (ne**********@yahoo.com) writes:
I am relatively new to SQL Server, although I have used Oracle
extensively.
In Oracle, there are system tables that you can query in order to get
a list of all schemas and all the tables in them. Is there a similar
concept in SQLServer? How would I find about the system dictionary
tables?
Yes, there are. They are documented in Books Online. Beware that not
all tables are documented, and not all columns in the documented tables
are docuemented. You should stick to the documented tables and columns.
In the next version of SQL Server, Microsoft is reworking how they
store metadata, and there will be a new interface for system data.
The current system tables will remain as legacy views.
Note also that Microsoft offers a set of property functions through
which you can retrieve information about various objects. There
are objectproperty(), indexproperty(), databasepropertyex() to name
a few. Again, look in Books Online.
Finally, MS SQL Server implements the INFORMATTION_SCHEMA views which
are ANSI standard for metadata. Many people are fond of these, I am not.
The problem with them is that they are incomplete, so you still need
to query system tables anyway. They are good for portability though.
--
Erland Sommarskog, SQL Server MVP,
so****@algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp