How to export a SQL Server 2008 Database Diagram to another DB?

后端 未结 6 1318
遇见更好的自我
遇见更好的自我 2020-12-12 20:53

I use the handy Database Diagramming tool in SQL Server 2008 for creating and managing relationships. I have exported the sourceDB to the destinationDB but the diagram does

6条回答
  •  南方客
    南方客 (楼主)
    2020-12-12 21:33

    As in C Isaze answer, there are three simple steps:

    1- Create the same number of "dummy" diagrams in the target server where you want to copy the diagrams

    2- Add the target server as a Linked Server in the source server

    enter image description here enter image description here enter image description here

    3- run this script on source server

    update [LINKEDSERVER].TARGETDB.[dbo].sysdiagrams set [definition]=
        (SELECT [definition] from SOURCEDB.[dbo].sysdiagrams WHERE diagram_id = 1)
        where diagram_id=1 
    

提交回复
热议问题