Answered Database Diagrams tool

  • 26 มิถุนายน 2549 15:34
     
     

    When I use the sql 2005 "Database Diagrams"  tool for the first time I always get the message: "The Database does not have one or more of the support objects required to use database diagramming. Do you wish to create them?"

     

    1. Does anyone know what the " support objects" referred to are?

    2. Why SQL doesn't automatically create these support objects for me? (e.g. do they require a lot of hard disk space so they shouldn't routinely  be created?)

    3. Is there any way to make Sql automatically create them?

    If you can address any of these points I'd appreciate it.

     

    TIA,

     

    barkingdog

ตอบทั้งหมด

  • 27 มิถุนายน 2549 5:10
    ผู้ดูแล
     
     คำตอบ


    The support objects are the following objects that will be created during the action:

    sp_helpdiagramdefinition
    sp_creatediagram
    sp_renamediagram
    sp_alterdiagram
    sp_dropdiagram
    fn_diagramobjects
    sp_upgraddiagrams
    sysdiagrams
    PK__sysdiagrams__ID
    UK_principal_name
    sp_helpdiagrams

    I don´t know why they are not created at creation time of the database, but you can influence this design by creating the definitions once in the model database. As the model database is the template for new database, once theay are created here, they will exists in every new database.


    HTH, Jens SUessmeyer.

    ---
    http://www.sqlserver2005.de
    ---

  • 28 มิถุนายน 2549 12:21
     
     

    I create all my databases from a script, and I can't always guarantee the model database design.

    Is there a single system sproc that can be called to generate all those bits?

    Otherwise - what's the best way to get all those bits into the model database? You can't add a diagram to the model database..

    Thanks...

  • 29 มิถุนายน 2549 6:38
    ผู้ดูแล
     
     


    As noone prevents you from scripting the stored procedures and related objects, just script them and put them in your custom script you are executing.

    HTH, Jens SUessmeyer.

    ---
    http://www.sqlserver2005.de
    ---