Hello --
I am not yet an advanced SQL code writer.
Can someone help me add the extended property 'Description' to a list of
columns resulting from this code?
SELECT
SUBSTRING(table _name,1,20) AS "Table",
SUBSTRING(colum n_name,1,30) AS "Column",
SUBSTRING(data_ type,1,13) AS "DataType",
character_maxim um_length AS "Length",
numeric_precisi on AS "Precision" ,
numeric_scale AS "Scale"
FROM information_sch ema.columns
WHERE
table_schema = 'DBO'
ORDER BY table_name, ordinal_positio n
The following code
SELECT objname AS ColName,
value AS Description
FROM ::fn_listextend edproperty(NULL , 'user', 'dbo', 'table',
'tablename', 'column', null)
results in:
ColName Description
....name of column description of column
for one table at a time
I want to include the value of 'Description' to the first set of code.
Would it be simpler to use sysobjects and sysproperties for the Description?
If so, can someone suggest how?
This code gives me the table and comment for a column, but I can't figure
out how to add the column to which the comment belongs.
SELECT obj.name AS [Table], prop.value AS [Description]
FROM sysobjects obj JOIN sysproperties prop ON obj.id = prop.id
Thanks for any help.
Larry Mehl
---
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.806 / Virus Database: 548 - Release Date: 12/5/2004