Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6

    Unanswered: create views in the order of their dependency

    In SQL 2K...

    i need to write a script that writes a script that creates all views in the order that they are nested and I am feeling lazy. Does anyone have anything handy?

    For example if View_BOB says...

    CREATE VIEW VIEW_BOB
    AS
    SELECT COL_1 FROM VIEW_JOHN

    I need the script to generate a script that creates View_JOHN before View_BOB.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  2. #2
    Join Date
    Feb 2007
    Posts
    2
    You can use Enterprise Manager to generate the script for you and it will take care of dependency of the objects.

    SQL Server Helper
    http://www.sql-server-helper.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •