How to get tables/views/columns in ODBC (& OleDb)
- From: David Thielen <thielen@xxxxxxxxxxxxx>
- Date: Sun, 24 Aug 2008 18:56:29 -0600
Hi;
Note, this is all with ADO.NET using the ODBC and OleDb drivers
We've been using DataTable schemaTable = conn.GetSchema("views");
which was working ok and now we are finding some drivers where under
both ODBC and OleDb it is now returning hundreds of system views -
while table still seems to be ok (for now).
So my question is, how do I get the following from ODBC and OleDb in a
way that will work on all databases. And if there is no way to do
that, how do I do it for Sql Server 2000, Sql Server 2005, and Access.
1) Enumerate all user tables in a database.
2) Enumerate all tables (user & system) in a database.
3) Enumerate all user views in a database.
4) Enumerate all views (user & system) in a database.
5) Enumerate all columns in a table or view.
6) For a column, get it's data type.
7) Enumerate all user stored procedures in a database
8) Enumerate all stored procedures (user & system) in a database.
9) For a stored procedure, get all parameters and their data type.
10) For all objects - get the description of it in the metadata.
From reading the specs for ODBC and OleDb it seems that everythingabove (with the possible exception of item 9) should be doable in a
standard way that works for every implementation.
Help please.
thanks - dave
david@at-at-at@windward.dot.dot.net
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com
Cubicle Wars - http://www.windwardreports.com/film.htm
.
- Follow-Ups:
- RE: How to get tables/views/columns in ODBC (& OleDb)
- From: "Jialiang Ge [MSFT]"
- RE: How to get tables/views/columns in ODBC (& OleDb)
- Prev by Date: Re: Text file driver ODBC issue
- Next by Date: Is there a standard way to do the following in ODBC and/or OleDb
- Previous by thread: RE: Text file driver ODBC issue
- Next by thread: RE: How to get tables/views/columns in ODBC (& OleDb)
- Index(es):
Relevant Pages
|