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 data
I find this works better:
SELECT type, * FROM sys.objects WHERE OBJECT_DEFINITION(object_id) LIKE '%' + @ObjectName + '%' AND type IN ('V') ORDER BY name
Filtering VIEW_DEFINTION inside INFORMATION_SCHEMA.VIEWS is giving me quite a few false positives.
VIEW_DEFINTION
INFORMATION_SCHEMA.VIEWS