find the views dependency on other views

  • Hi,

    I have a query to find the views dependency on other views:,

    Here I have a table of 3 columns(100+ rows). first column view name(100+ different views). second column dependency (either table or view) and third column dependency type T for Table and V for View.

    Purpose: in order to create the script, we need to put them in order of dependency, other wise the script will fail saying that the OBJECT (the view on which it depends) DOES NOT EXIST

    Can anybody give me suggestions for above query

  • You may find this article useful

    Pradeep Adiga
    Blog: sqldbadiaries.com
    Twitter: @pradeepadiga

  • I would be tempted to use Red-Gate SQL Compare to generate your script (you can download a trial at the link provided).

    Use your database containing the tables and views as the source database, and a blank database as the target database. SQL Compare will generate a script to create the objects, and (in my experience at least) in the correct order.

    Chris

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

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