当前位置: 移动技术网 > IT编程>数据库>MSSQL > 获取数据表列相关数据

获取数据表列相关数据

2019年12月28日  | 移动技术网IT编程  | 我要评论

虽然本人在开发数据库时,不太使用视图,但是还是知道

如何获取视图中使用的所有表列:

 

 select * from information_schema.view_column_usage

 


如何获取包含视图所有表:

 

select * from information_schema.view_table_usage 

 

获取包含有任何约束的所有列:

 

 select table_name,column_name,constraint_name from information_schema.constraint_column_usage 

 

获取表列的信息:

 

select * from information_schema.columns  
  
where information_schema.columns.table_name='table_name' 

 

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网