Thursday, March 17, 2011

Copy or move database diagram from for sql server 2005



The entire diagram's information is stored in the dbo.sysdiagrams.
If you wish to see the table dbo.sysdiagrams which is in System Table folder of A,then write the following statement


select * from A.dbo.sysdiagrams	 


It will list all the diagram information.

Now if you need to move or copy the all the diagrams of database A to the B then write the following sql statement and run:


  insert into B.dbo.sysdiagrams 
select [name], principal_id, version,definition from A.dbo.sysdiagrams

It will copy a specific diagrams from database A to database B


insert into B.dbo.sysdiagrams
select [name],diagram_id , version,definition from A.dbo.sysdiagrams
where diagram_id =13





No comments:

Post a Comment