473,734 Members | 2,511 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(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
Jul 23 '05 #1
0 1815

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

Similar topics

2
2008
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 properties before parent class properties) Using TypeDescriptor.GetProperties(), the order of the returned properties is also wrong.
2
1754
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, Aravind.
0
1455
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 never change. What would be the command to rerieve these single column lookups in ASP script? Or do I have to create access tables just to hold these static lookup values?
6
8334
by: rguti | last post by:
Hi, Does anybody know how to get the column description for a table in SQL Server 2000? Thanks.
5
51592
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
22063
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 column's position is in between Col2 and Col3: MyTable(Col1, Col2, New_Column, Col3)
6
2075
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 prices as columns) and I have a set of different customers in a table. Now I want to generate a query combining a specific customer with a specific price list - in other words, select a specific column from the price list table. As I am a bloody...
2
4053
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 (32-bit);UID=ODBC;PWD=GOCATS;System=143.42.191.135" Dim Order As Integer Order = CInt(txtOrderNumber.Text) Dim myConnection As New Data.Odbc.OdbcConnection(connectionstring) Dim mysql1 As String = "select rmsfiles2.obcop200.line#,...
1
4433
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 same piece of code which works for PostgreSQL as well. So, i want the list of indexes on a column of a table if i know the column name at that time or list of all the indexes on all the columns of the given table. Below is the java Code written for...
0
8776
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9449
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9236
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8186
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.