Database Diagrams

  • I'm moving a database tables, views, and SP from Database A to Database B. Is there a way to move the diagrams as well?

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

    Gregory A. Larsen, MVP

  • Database diagrams are kept in system table 'dtproperties'. After database tables, views etc been moved into database B, you can import data from this table in database A into the same table in database B.

  • I'll give that a shot.

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

    Gregory A. Larsen, MVP

  • Greg, try using the following...

    DECLARE @ObjectID int

    -- Get the objectid's of the diagrams

    select @ObjectID = isnull(objectid,0) from <put DBName Here>..dtproperties where property = 'DtgSchemaNAME'

    -- Add them to the new table...

    insert into <put NEW DBName Here>..dtproperties (objectid,property,value,lvalue,version)

    select property, value, lvalue, version

    from <put DBName Here>..dtproperties

    where objectid = @ObjectID

    make sure to modify as needed.

    Gary Johnson

    DBA

    Sr DB Engineer




    Gary Johnson
    Microsoft Natural Language Group
    DBA, Sr. DB Engineer

    This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.

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

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