tags:

views:

218

answers:

2

We document our SQL Server database by creating table and column level Description extended properties. We usually enter these via SSMS.

My question is this. I'm creating a C# application where I'd like to read the extended properties for a particular table and its associated columns.

Can someone show me how I might go about doing this?

Thanks - Randy

A: 

Read this: http://stackoverflow.com/questions/1486536/extract-sql-column-extended-properties-from-linq-in-c and see if that's something you could do in your situation.

md5sum
Could someone explain why this was downvoted?
md5sum
+3  A: 

You simply ask for them using the built-in fn_listextendedproperty. The result of this function is an ordinary table result set that you read in C# using your data access tool of choice (SqlCommand/SqlDataReader, linq, datasets etc).

Remus Rusanu
+1 for the built-in function reference.
md5sum