Retrieve Columns from Stored Procedure in any DB....

  • Thread starter Paul Riddington
  • Start date
P

Paul Riddington

I am writing a tool that will (hopefully) be able to query
any database and retrieve tables, views and stored proc's
along with their columns, parameters etc.

I have been successfull so far using the
GetOleDbSchemaTable method on the OleDbConnection object
as shown below...

schemaTable = cnn.GetOleDbSchemaTable
(OleDbSchemaGuid.Procedure_Columns, new Object[] {null,
null, "sp_Test", null});

However, this specific code (used to retrieve the columns
returned from a stored procedure fails with the message:

"The Procedure_Columns OleDbSchemaGuid is not a supported
schema by the '[provider name]' provider."

I believe this is because I have MDAC 2.7 installed.
The following URL
(http://msdn.microsoft.com/library/default.asp?
url=/library/en-
us/cpref/html/frlrfsystemdataoledboledbschemaguidclassproce
dure_columnstopic.asp) has the the comment...

"Note The Procedure_Columns schema is not supported by any
OLE DB providers that ship in MDAC version 2.7. Refer to
your database documentation to determine whether you can
retrieve this schema information by querying the system
tables of your database."

I have found numerous posts on using SQL Server specific
commands to achieve this but wondered if there is a more
generic approach that I can use to cover numerous
databases? Also, why have microsoft stopped supporting the
Procedure_Columns query in the latest release of MDAC?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top