Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retrieving SQL Server Extended Properties From C#

Tags:

c#

sql-server

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

like image 803
Randy Minder Avatar asked Sep 13 '26 05:09

Randy Minder


1 Answers

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).

like image 168
Remus Rusanu Avatar answered Sep 15 '26 18:09

Remus Rusanu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!