如何查找哪些视图正在使用 SQL Server (2008) 中的某个表?

2021-09-17 00:00:00 sql sql-server views

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

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%'

相关文章