如何查找哪些视图正在使用 SQL Server (2008) 中的某个表? [英] How to find which views are using a certain table in SQL Server (2008)?

查看:53
本文介绍了如何查找哪些视图正在使用 SQL Server (2008) 中的某个表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须向表中添加几列,并且还需要将这些列添加到使用此表的所有视图中.

I have to add a few columns to a table and I also need to add these columns to all the views that use this table.

是否可以获得数据库中使用某个表的所有视图的列表?

Is it possible to get a list of all the views in a database that use a certain table?

推荐答案

应该这样做:

SELECT * 
FROM   INFORMATION_SCHEMA.VIEWS 
WHERE  VIEW_DEFINITION like '%YourTableName%'

这篇关于如何查找哪些视图正在使用 SQL Server (2008) 中的某个表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆