schema change

  • We have a few views that will be changing in a couple of weeks (column names). Is there a way to get a list of all views/stored procedures that use the views that will be changing?

  • Don't think the below code is complete but might get you in the right direction. For instance the type list is not going to be complete if you have more objects that might rely on the view.

    SELECT obj.name, obj.type_desc, def.definition

    FROM sys.sql_modules def

    inner join sys.objects obj

    on (obj.object_id = def.object_id)

    where type in ('P','FN')

    and def.definition like '%vw_%'

    Further information can be found in BOL - Querying the SQL Server System Catalog FAQ and I'm sure some of the more experienced DBA's have better solutions.

    - note removed the top 5 was using that for testing purposes.

  • This is exactly what I was looking for, thanks!!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply