Search This Blog

Showing posts with label Database Diagram Backup. Show all posts
Showing posts with label Database Diagram Backup. Show all posts

Sunday, March 27, 2011

How to take backup of Database Diagrams


Hi,

I came across a question on MSDN, thought lets share it with you as well. Q: We have a Database Diagram in one of our database, we want to move this diagram to some other instance of SQL. How to do that? Now this is pretty good I can say, I don't remember if I could have ever though of it.


So lets try to explore it. So lets first create a database diagram:


Environment

SQL Server Edition Version: SQL Server 2008 (10.0.2531) Developer Edition x86

Windows XP SP3

So I used ADVENTUREWORKS database and created Database Diagram (as shown in above picture). Now when ever we created Database Diagram, its meta data gets saved inside same database (under SYSTEM tables).

Prior to jumping to think how to move this diagram to another instance, I would like to think about how normally we take/move databases or its objects?


If I am not wrong we have EXPORT/IMPORT utility to take object level movement of database objects. So lets try to explore the same.


















So as we can see, we can export the database diagram but we also have to export objects ith which Database Diagram objects are associated. If we don't include them in Export them table will be moved along with data but we will be able to open this Database Diagram completely.


Regards

Gurpreet Sethi