• Nice article! A suggestion to improve readability. If you have a table valued function which can split a delimited string then you could do the following at the top of the script:

    DECLARE @Tables VARCHAR(MAX), @Views VARCHAR(MAX), @Procedures VARCHAR(MAX)

    SELECT

    @Tables = 'Table1,Table2,Table3',

    @Views = 'View1,View2,View3',

    @Procedures = 'Procedure1,Procedure2,Procedure3'

    Then your WHERE clause would just look something like this

    WHERE name IN (SELECT Value FROM dbo.SplitString(@Tables))

    This would be more readable (you only have to look one place for which objects will be affected). If you don't like the TVF suggestion you could just declare table variables and insert the names in and your WHERE clause would just reference the table variable instead.