I will use the following:
SELECT *
FROM ::fn_listextendedproperty ('MS_Description', 'user', 'dbo', 'table',
<Table Name>, 'column', <Field Name>)
Thank you Dejan.
[quoted text, click to view] "Dejan Sarka" wrote:
> > How we can read the specified Description of the fields in SQL table from
> > another software like VB or VFP?
>
> use INFORMATION_SCHEMA views (TABLES, COLUMNS and other) to get the schema
> information. If you are talking about extended properties, then this article
> should help you:
http://developer.com/db/article.php/3361751.
>
> --
> Dejan Sarka, SQL Server MVP
> Mentor
>
www.SolidQualityLearning.com >
>
The descriptions for each of the column in the table are stored in a system
table called sysproperties, but it is not documented in SQL Server Books
Online. So accessing this table directly is not generally recommended
however, you can do the following in t-SQL:
SELECT s2.id, s1.name,
( SELECT s3.value
FROM sysproperties s3
WHERE s3.id = s1.id
AND s3.smallid = s1.colid ) AS "col desc"
FROM syscolumns s1
INNER JOIN sysobjects s2
ON s1.id = s2.id
WHERE s2.name = @tbl ;
If you are looking for a documented method, you can use a system function
called fn_listextendedproperty.
SELECT *
FROM ::fn_listextendedproperty (
NULL, 'user', 'dbo', 'table', 'tbl', 'column', DEFAULT ) ;
More details on using extended properties, along with examples, can be found
in SQL Server Books Online.
--
Anith