Results 1 to 1 of 1

Thread: "Generate Sql Script" Dependencies Orderer

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2001
    Location
    London UK
    Posts
    671

    "Generate Sql Script" Dependencies Orderer

    If you use the "Generate Sql Script" wizard in MS SQL to recreate databases then you may well get lots of error messages where it cannot add rows to Sysdepends for stored procedures or simply refuses to create views referencing other views as it tries to create them in the wrong order.

    The attached page will take the output from the wizard and search the text for dependencies and re-order the script so they are created in the right order.

    NB: Change the file extension from "txt" to "htm" to run it!!

    Limitations that I know about (but haven't fixed yet!) are...

    1) It does not at the moment cater for UDFs you will need to order these manually if required.
    2) If you have comments before the actual "CREATE" statement they may get moved into a different procedure as I am using the CREATE portion to delimit the start of a new procedure.

    Despite this I have found it to be an immense time saver so thought it would be worth posting.

    If anyone fixes these issues or makes any other improvements please repost it!
    Attached Files Attached Files

Posting Permissions

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



Click Here to Expand Forum to Full Width