How to pull Description from a SQL Column

I have a query which pulls some table schema; however, I would like to add the Description of each column to my query results, but I do not know what the correct code is..can anyone help please?  I am using sql-200 as the back end server.
SELECT column_name AS 'Field', data_type AS 'DataType', CHARacter_maximum_length AS 'MaximumLength'
FROM information_schema.columns
WHERE (table_name = 'CustomerContact')
 ORDER BY column_name

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Raja Jegan RSQL Server DBA & Architect, EE Solution GuideCommented:
If you have added Column descriptions using sp_addextendedproperty, then you can list it using fn_listextendedproperty function..
More info on these proc and functions here:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dzirkelbAuthor Commented:
I haven't added the descriptions like above, I am just adding them in the Table Design itself.
If you just added them in the Table Design itself:

If you like to view all the descriptions execute the following command.
select object_name(id), name from sysproperties

you can use the following system view to obtain the column
         SELECT *
         FROM   sys.extended_properties
         WHERE  class = 1 AND
                     major_id = object_id(N'dbo.Course') AND
                     name = 'MS_Description'
where "dbo.Course" is one of the tables in the database.

You can have more detail about sys.extended_properties at:; and

Also check out:
Select Column Information using SQL Server
Newly released Acronis True Image 2019

In announcing the release of the 15th Anniversary Edition of Acronis True Image 2019, the company revealed that its artificial intelligence-based anti-ransomware technology – stopped more than 200,000 ransomware attacks on 150,000 customers last year.

Raja Jegan RSQL Server DBA & Architect, EE Solution GuideCommented:
>> I am just adding them in the Table Design itself.

Adding it in Table Design is the GUI way of doing it using procedure sp_addextendedproperty..
And you can use this function to return those Descriptions in a query..
dzirkelbAuthor Commented:
The query listed provides the following error:

Error Source: .Net SqlClient Data Provider
Error Message: invalid object name 'sys.extended_properties'

any ideas?
System stored procedures and functions for working with extended properties
View an extended property: fn_listextendedproperty, sys.extended_properties

Both my queries look to be SQL Server 2000 ones. Correct them with help from:

sys.extended_properties (Transact-SQL)
Schema: How do I show the description property of a column? (for 2000, 2005)
Managing Extended Properties
Reporting Table Descriptions Using sys.extended_properties

Also Check this:
Raja Jegan RSQL Server DBA & Architect, EE Solution GuideCommented:

I have been stating from the beginning to use stored procedure sp_addextendedproperty and function fn_listextendedproperty for obtaining Column Description..

But the same when mentioned by k_murli_krishna was accepted as answer without even assisted points which is not totally fair.
Can you kindly justify..
dzirkelbAuthor Commented:
After seeing the solutionI accepted, and then looking at the stored procedures you gave, I can see I should have noticed your solution from teh code given on the page provided.  However, still a semi-rookie to teh site.  How do I adjust points?
Raja Jegan RSQL Server DBA & Architect, EE Solution GuideCommented:
Ok.. Not a problem..
I have clicked on Request Attention button so that Moderators can split points on behalf of you.

Kindly take care of this in future..
dzirkelbAuthor Commented:
The 2nd link was exactly what I am looking for, thanks!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.