Exporting a relationship diagram

  • Hi

    is there any way to save a relationship diagram as a query (like generate sql for a table or SP) or any other way to export the diagram and rebuilt it in another replication of the DB ?

  • Since the diagrams are saved in table dtproperties in each database, you could copy the data from one database to another.  Here is an example which has been tested:

    set identity_insert <targetdb>.dbo.dtproperties on

    go

    insert into <targetdb>.dbo.dtproperties

              (id, objectid, property, value, uvalue, lvalue, version )

    SELECT id, objectid, property, value, uvalue, lvalue, version

    FROM <sourceDb>.dbo.dtproperties

    go

    set identity_insert <targetdb>.dbo.dtproperties off

    go

    SQL = Scarcely Qualifies as a Language

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

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