Exporting Management studio diagrams

If you ever wanted to export the diagrams shown in Sql Server management studio to another database here’s a way to do this

INSERT INTO [ToDb].[dbo].sysdiagrams
SELECT [name],diagram_id , version,definition from [FromDb].[dbo].sysdiagrams

UPDATE [ToDb].[dbo].sysdiagrams
SET principal_id = 1

Replace the fromDb and ToDb with your own values and your ready

Leave a comment

Your email address will not be published.