Tuesday, May 09, 2006 8:44:40 PM UTC :: Filed Under SQL

For those of you who use Visio to due your database modeling, you might have run across the slight problem of not being able to get rid of the auto-generated foreign-keys in your tables (assuming you might have deleted and recreated a relation to the same table.)  If you try to generate a database from your model, you’ll find that the foreign keys that you thought you deleted still exist somewhere in ‘limbo’ and as a result, the error checking in Visio goes crazy.

So, how do you get rid of these ‘phantom foreign keys/relationships’?  Well, I found no solutions from Microsoft’s web site, but I did find some work-arounds from a few blog posts.  Here are two methods that seem to work:

Copy Data Structure into a New File

  1. Create a new database model diagram
  2. Select all of the items in your existing diagram and click Ctrl+C (Copy)
  3. Paste the entire diagram into your new diagram.  The “phantom” foreign keys will not be copied.

View (and Delete) Related Tables

  1. Right-click on the table with the problem
  2. Select "Show related tables" and you should get the "phantom relationship" back
  3. Select the relationship and delete it

 

Comments are closed.
Navigation
On this page....
Search
Archives
<July 2010>
SunMonTueWedThuFriSat
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567
Categories
Contact me
Send mail to the author(s) Contact Todd M. Taylor