直接贴代码了:

 

SELECT s.Name,Convert(varchar(max),tbp.value) as Description
                            FROM sysobjects s
                             LEFT JOIN sys.extended_properties as tbp ON s.id=tbp.major_id and tbp.minor_id=0 AND (tbp.Name='MS_Description' OR tbp.Name is null)  WHERE s.xtype IN('U')

 

 

示例:

SQL Server 中获取所有的用户表、用户视图的信息

 

用户视图:

SELECT s.Name,Convert(varchar(max),tbp.value) as Description
                            FROM sysobjects s
                             LEFT JOIN sys.extended_properties as tbp ON s.id=tbp.major_id and tbp.minor_id=0  AND (tbp.Name='MS_Description' OR tbp.Name is null) WHERE s.xtype IN('V') 

 

 

谢谢浏览!

相关文章:

  • 2022-03-06
  • 2021-11-06
  • 2022-12-23
  • 2021-07-18
  • 2022-12-23
  • 2021-08-31
  • 2021-12-20
  • 2021-08-10
猜你喜欢
  • 2021-05-28
  • 2021-10-06
  • 2021-08-07
  • 2022-12-23
  • 2022-01-08
  • 2022-12-23
  • 2021-09-18
相关资源
相似解决方案