473,397 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Include column Description with list of table properties

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(column_name,1,30) AS "Column",
SUBSTRING(data_type,1,13) AS "DataType",
character_maximum_length AS "Length",
numeric_precision AS "Precision",
numeric_scale AS "Scale"
FROM information_schema.columns
WHERE
table_schema = 'DBO'
ORDER BY table_name, ordinal_position
The following code

SELECT objname AS ColName,
value AS Description
FROM ::fn_listextendedproperty(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
Jul 23 '05 #1
0 1799

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dawid Mostert | last post by:
Hi, I'm trying to get a list of properties from a hierarchy of classes, using reflection. Using Type.GetProperties(), I get the list back in "reverse hierarchy order" (derived class...
2
by: Aravind | last post by:
Hi guys, Is there any way to access the full column form a table into a List Box..If you have some samle codes ..plz forward them..thats very useful for me to refer.. Thanks in Advance,...
0
by: gerry | last post by:
I want to populating an asp list box from a simple access lookup list (single column not a table.)I don't want to create tables just for lookups as the values will be descriptive only and will...
6
by: rguti | last post by:
Hi, Does anybody know how to get the column description for a table in SQL Server 2000? Thanks.
5
by: Markus | last post by:
I tried this: ALTER TABLE Dokumente DROP COLUMN docPrioID but I get this errormessage: DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: COLUMN;ABLE Dokumente DROP;CONSTRAINT
13
by: annecarterfredi | last post by:
I'd like to add a new column to an existing table at a specific column location... Existing table definition: MyTable(Col1, Col2, Col3) I want to add a new column in MyTable and the new...
6
by: BigAl | last post by:
Hi, although I was intensely searching the web, I couldn't find an answer for the following problem: I have a set of different price lists organized in a table (articles as rows, different...
2
by: kjewell23 | last post by:
I'm getting this error column qualifier or table undefined in asp.net Dim connectionstring As String connectionstring = "DRIVER=Client Access ODBC Driver...
1
by: venkat chitta | last post by:
Hi All, I want to know how to get a list of all indexes created on a column of a table in PostgreSQL. There is a program block in our application which do this in oracle, now i want to write the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.