Database diagrams are stored in the 'dtproperties' table within the database. So, database diagrams can be transferred to a different database, by transferring the contents of this table.
For example , run the following query to transfer the diagram named 'MyTableDesign' from 'pubs' database to 'northwind':
INSERT northwind..dtproperties
SELECT objectid, property, value, lvalue, version
FROM pubs..dtproperties
WHERE objectid =
(
SELECT objectid
FROM pubs..dtproperties
WHERE value='MyTableDesign'
)
Make sure, the tables referenced by these diagrams already exist in the target database, or else these diagrams won't show up in the target database.
Tuesday, 22 May 2007
Subscribe to:
Post Comments (Atom)
1 comment:
For SQL 2000 SP4 you need to add the uvalue column:
INSERT northwind..dtproperties (
objectid, property, value, uvalue, lvalue, version
)
SELECT
objectid, property, value, uvalue, lvalue, version
FROM pubs..dtproperties
WHERE objectid =
(
SELECT objectid
FROM pubs..dtproperties
WHERE value='MyTableDesign'
)
Post a Comment