Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/301.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 获取表格';SQL Server中的s描述_C#_Sql Server - Fatal编程技术网

C# 获取表格';SQL Server中的s描述

C# 获取表格';SQL Server中的s描述,c#,sql-server,C#,Sql Server,我只想得到表的MS\u描述 目前,我只为列提供了它: select sc.name, sep.value [Description] from sys.tables st inner join sys.columns sc on st.object_id = sc.object_id left join sys.extended_properties sep on st.object_id = sep.major_id

我只想得到表的
MS\u描述

目前,我只为列提供了它:

select 
    sc.name, 
    sep.value [Description]
from sys.tables st
inner join sys.columns sc on st.object_id = sc.object_id
left join sys.extended_properties sep on st.object_id = sep.major_id
                                     and sc.column_id = sep.minor_id
                                     and sep.name = 'MS_Description'
where st.name =@TableName
我也有@TableName作为参数
谢谢

尝试此操作-基本上使用
次要_id=0
获取表的描述(而不是任何列):


完美的泰斯是我想要的。。。另一个问题是针对一个表中的任何列,但我只想要表描述
SELECT 
    t.Name, 
    sep.* 
FROM 
    sys.tables t
INNER JOIN 
    sys.extended_properties sep ON t.object_id = sep.major_id
where 
    sep.Name = 'MS_Description'
    AND sep.minor_id = 0    -- not any column - but the table's description