Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieving SQL column extended properties

Status
Not open for further replies.

Glasgow

IS-IT--Management
Jul 30, 2001
1,669
GB
I have an application within which I maintain a dedicated table that effectively acts as a data dictionary with one row per database field.

I'm considering eliminating the table in favour of using the SQL database's own Extended Properties feature.

However, I'm not sure how, when I am manipulating a particular field using VB and ADO, I might access the extended properties for the individual field.

Can anyone shed any light please? Is there a way I can do it with ADO or would I have to execute a separate query to return a field's extended properties. I can access the field's "standard" properties using ADO field's Properties collection. I guess I'm wondering if there's something similar for extended properties.

 
Glasgow:

Check out the Microsoft SQLDMO Control Library in references.

Also, if you're working with SQL Server 2000, there are a ton of samples that came with the app. They would be in Program Files\Microsoft SQL Server\80\Tools\DevTools\Samples.

There are samples for the SQLDMO, including one called "Explorer", which is exactly what you're looking for, I believe.

IHTH,

Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.

My newest novel: Wooden Warriors
 
Thanks for the reply.

Although I have the DevTools parent folder you refer to on my box, it does not seem to contain a samples subfolder unfortunately and I can't unearth anything in the SQLDMO documentation that suggests how I might retrieve extended properties.

Of course SMO seems to be more geared up for this but I don't think I can use that with VB6 (I'm sure I pursued that in another thread). SMO has a column object with an ExtendedProperties collection of ExtendedProperty objects which I assume would give me what I want.

I don't suppose you can point me at a particular SQLDMO object / property that I can then search for to get the ball rolling?
 
Thanks again.

I have trawled through the SQL-DMO documentation in SQL 2000 BOL and the only references to extended properties is in in the context of database scripting.

I conclude that SQL-DMO will not, unfortunately, provide what I need and the best approach (if I am to use the extended properties at all) would probably be to call the built-in SQL functions and stored procedures from VB6 (e.g. fn_listextendedproperty).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top