Sunday, February 19, 2012

How to copy SQL Diagrams

How can I copy SQL diagram from one source to other destination?
I would appreciate if you let me know.
Thanks.Here are my assumptions:
1. both destination database schema and source database schema are
identical.
2. that your destination database is missing diagram.
3. source database have diagram and you want to move the diagram to
destination database.
If my assumptions are true, then you can manually add all the user tables to
diagram on destination database, Just recreate diagram!
> Thanks.
> "Kevin" wrote:
>|||What do you mean by transfer the diagram.
Do you mean just create brand new one at the different database?
I would appreciate if you let me know.
Thanks.
"Kevin" wrote:
> The easiest method to transfer your diagram is to do a complete backup and
> restore onto the destination database. If you don’t have the luxury of
> performing a complete backup and restore, then you’ll have to do a very
> difficult task to transfer the diagram.
> "Justin Doh" wrote:
>|||The easiest method to transfer your diagram is to do a complete backup and
restore onto the destination database. If you don’t have the luxury of
performing a complete backup and restore, then you’ll have to do a very
difficult task to transfer the diagram.
"Justin Doh" wrote:

> How can I copy SQL diagram from one source to other destination?
> I would appreciate if you let me know.
> Thanks.
>|||If you donot want to take the back up of source database, for getting the
database diagram, another way is, use the DTS with import/export wizard and
DTS the (copy) the DTProperties tables of Source database into Destination
database.
After this DTS process completes, check for the DB diagram in the
destination database thru enterprise manager.
Hope this helps
Thanks,
Siva
"Justin Doh" wrote:

> How can I copy SQL diagram from one source to other destination?
> I would appreciate if you let me know.
> Thanks.
>|||Just check my article on subject "Copying Database Diagrams" >>
http://www.dotnetforce.com/Content.aspx?t=a&n=208
Best Regards
Vadivel
http://vadivel.blogspot.com
http://thinkingms.com/vadivel
"Justin Doh" wrote:

> How can I copy SQL diagram from one source to other destination?
> I would appreciate if you let me know.
> Thanks.
>|||Hi SivaCh,
Thank you for your advice.
Where do I find the DTProperties tables in the DTS package?
I know it is there in the server, but how should I go about selecting that
particular
system table?
I would appreciate if you let me know.
Thanks.
Justin
"SivaCh" wrote:
> If you donot want to take the back up of source database, for getting the
> database diagram, another way is, use the DTS with import/export wizard an
d
> DTS the (copy) the DTProperties tables of Source database into Destination
> database.
> After this DTS process completes, check for the DB diagram in the
> destination database thru enterprise manager.
> Hope this helps
> Thanks,
> Siva
> "Justin Doh" wrote:
>|||Justin,
You can try the following. But this is a tip from another person
(Unfortunately I can't find out the original author) so I won't take credit
on this.
How to transfer database diagrams to a different database?
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, uvalue, 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
.
If the target database already has a diagram with the same 'objectid', you
will see unpredictable results, when Enterprise Manager displays the
diagrams. In that case, you might want to explicitly specify a unique value
to the 'objectid' column while transferring rows from the source
'dtproperties' table.
Hope this help.
Dennis Lam
"Justin Doh" wrote:

> How can I copy SQL diagram from one source to other destination?
> I would appreciate if you let me know.
> Thanks.
>

No comments:

Post a Comment