Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 How to query info of sql 2000's Table's or Field's "Description" properties ??

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-02-05 : 08:14:49
Kai writes "I use ASP file and ADO to access to SQL server 2000's database...

In my application, I need to display the database's table names and description, and that table's field's names, datatypes and descriptions "dynamically" (on the fly...)

Q's #1: How I do it in the best way??

I tried using ADO's "connection" object's "adSchemaTables" method,
but, the "description" column or field is always "empty" (nothing there!), I already put in some words in that table's
"design table" property's associated field named "Description",
also in that table's fields' "Description"s.

Q's #2: Why? (about the above ...)


I'vs noticed only in SQL server 2000, there is a "Description" field in "Design Table"'s Table properties menu, I could not find this new feature in any "What's new in SQL server 2000..." mentioned, why?

Q's #3:
Where I can query any info about SQL server 2000's "Extended Properties" like this one, Table's or Filed's "Description"s??



Please help, thanks a lot!

Kai"

ValterBorges
Master Smack Fu Yak Hacker

1429 Posts

Posted - 2003-02-05 : 08:49:33
sp_help (Returns 7 Recordsets)
or querying the INFORMATION_SCHEMA Views
or system tables directly

also take a look
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=23465

Edited by - ValterBorges on 02/05/2003 08:51:38
Go to Top of Page

jasper_smith
SQL Server MVP & SQLTeam MVY

846 Posts

Posted - 2003-02-05 : 16:18:02
Look in BOL for fn_listextendedproperty
The descriptions enterend via EM show up in the result set with a
name column of 'MS_Description' thus the following query returns
all column descriptions from EM for table T1

SELECT *
FROM ::fn_listextendedproperty (NULL,
'user', 'dbo', 'table', 'T1', 'column', default)
where name = 'MS_Description'



HTH
Jasper Smith
Go to Top of Page
   

- Advertisement -