问题
I can use " Microsoft.SqlServer.Management.Smo.Table " in C# to get a table columns of a Sql Server 2005 database.
I have got the column.Name, but how can I get the column's Description in C#?
I have saw the link: SQL Server: Extract Table Meta-Data (description, fields and their data types)
But how can I use C# "Microsoft.SqlServer.Management.Smo" dll to get a column's Description?
回答1:
Say your Smo.Table object is named t.
This will get the description:
t.Columns["ProductID"].ExtendedProperties["MS_Description"].Value
回答2:
Why don't you use the result from the query described in the link you gave?
来源:https://stackoverflow.com/questions/1098630/how-to-use-c-sharp-to-get-columns-description-of-sql-server-2005